feat: 取消显示名称,统一用户名,大小写不敏感去重,一次性改名
All checks were successful
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 3s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 16s
Test / e2e-test (push) Successful in 52s

- 注册: 去掉display_name字段,用户名大小写不敏感去重
- 登录: 大小写不敏感匹配
- 用户菜单: 显示用户名+改名按钮(只能改一次)
- /api/me/username: 一次性改名API
- 启动时: sync display_name=username, 发通知告知用户
- 前端: 所有display_name显示改为username

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-12 22:20:23 +00:00
parent ca3f409827
commit fdc7b20929
6 changed files with 89 additions and 26 deletions

View File

@@ -165,6 +165,8 @@ def init_db():
c.execute("ALTER TABLE users ADD COLUMN brand_align TEXT DEFAULT 'center'")
if "role_changed_at" not in user_cols:
c.execute("ALTER TABLE users ADD COLUMN role_changed_at TEXT")
if "username_changed" not in user_cols:
c.execute("ALTER TABLE users ADD COLUMN username_changed INTEGER DEFAULT 0")
# Migration: add tags to user_diary
diary_cols = [row[1] for row in c.execute("PRAGMA table_info(user_diary)").fetchall()]