feat: 收口多品牌与模板构建基础

This commit is contained in:
que01 committed 2026-09-25 02:55:46 +08:00
1 parent 0425a1c672
commit 77224ea51f
317 files changed
+11290 -1158

No files matched your search

@@ -0,0 +1,13 @@
# 管理员账号使用闭环
## 目标
让手动添加的品牌成员可以安全完成首次登录和密码更新,并让 `editor` 在后台只看到自己有权限使用的功能。
## 规则
- 手动创建成员时标记 `mustChangePassword`。
- 登录响应返回当前成员角色和是否需要改密。
- 首次改密必须校验初始密码,成功后清除标记。
- `editor` 隐藏系统管理菜单,直接访问系统管理路由回到概览页。
- 密码只保存 hash,不返回或记录明文。
@@ -0,0 +1,23 @@
# 进度
- 任务:管理员账号使用闭环
- 形态:epic
- 进度:3/3
- 当前:账号使用闭环已完成,下一步进行多品牌真实初始化验收。
## 已完成
- `AdminUser.mustChangePassword` 字段和 Prisma migration 已添加。
- 新增 `POST /admin/session/change-password`。
- 登录响应包含 `role` 和 `mustChangePassword`。
- 手动添加成员自动标记首次改密。
- 后台首次登录改密页面已接入。
- `editor` 隐藏系统管理菜单,直接访问系统管理路由会回到概览。
## 验证
- `pnpm typecheck`:通过。
- `pnpm --filter @personal-brand/admin build`:通过。
- `pnpm format:check`:通过。
- `pnpm --filter @personal-brand/api exec prisma migrate deploy`:已成功应用,`mustChangePassword` 字段已确认落库。
- `pnpm --filter @personal-brand/api test:integration`:34/34 通过。
@@ -0,0 +1,4 @@
id,title,task_type,depends_on,status,task_dir,acceptance_criteria,validation_command,notes
1,增加首次改密状态和 API,single-full,,DONE,tasks/password-api,手动成员必须改密且密码 hash 存储,pnpm typecheck,新增 schema 字段、迁移和 change-password API
2,接入后台首次改密与角色菜单,single-full,1,DONE,tasks/password-ui,editor 隐藏系统管理并显示改密页面,pnpm --filter @personal-brand/admin build,登录响应持久化角色和改密状态
3,补齐回归测试与交付记录,single-full,1;2,DONE,tasks/regression,登录、改密、编辑者路由和迁移均有验证,pnpm --filter @personal-brand/api test:integration,Prisma migration 已落库,API integration 34/34 通过
1 id title task_type depends_on status task_dir acceptance_criteria validation_command notes
2 1 增加首次改密状态和 API single-full DONE tasks/password-api 手动成员必须改密且密码 hash 存储 pnpm typecheck 新增 schema 字段、迁移和 change-password API
3 2 接入后台首次改密与角色菜单 single-full 1 DONE tasks/password-ui editor 隐藏系统管理并显示改密页面 pnpm --filter @personal-brand/admin build 登录响应持久化角色和改密状态
4 3 补齐回归测试与交付记录 single-full 1;2 DONE tasks/regression 登录、改密、编辑者路由和迁移均有验证 pnpm --filter @personal-brand/api test:integration Prisma migration 已落库,API integration 34/34 通过