注册码 + 管理员系统:

User 模型新增 is_admin 字段
新增 InviteCode 模型(邀请码表)
注册接口必须提供有效邀请码,使用后自动标记
管理员接口:查看所有用户、启用/禁用用户、生成/删除邀请码
前端新增管理面板页面 /admin,导航栏对管理员显示入口
注册页面新增邀请码输入框
选择性超话签到:

新增 GET /api/v1/accounts/{id}/topics 接口获取超话列表
POST /signin 接口支持 {"topic_indices": [0,1,3]} 选择性签到
新增超话选择页面 /accounts/{id}/topics,支持全选/手动勾选
账号详情页新增"选择超话签到"按钮
This commit is contained in:
2026-03-17 17:05:28 +08:00
parent 2fb27aa714
commit e514a11e62
26 changed files with 649 additions and 18 deletions

View File

@@ -44,8 +44,8 @@ def create_database():
hashed_password = hash_password(test_password)
cursor.execute("""
INSERT INTO users (id, username, email, hashed_password, is_active)
VALUES (?, ?, ?, ?, 1)
INSERT INTO users (id, username, email, hashed_password, is_admin, is_active)
VALUES (?, ?, ?, ?, 1, 1)
""", (test_user_id, test_username, test_email, hashed_password))
conn.commit()