Move done DOCREV short-terms, checklists, and handoffs into archive/ops and retarget relative links after Round20 close-out. Co-authored-by: Cursor <cursoragent@cursor.com>
1.7 KiB
1.7 KiB
title, status, created, updated, severity
| title | status | created | updated | severity |
|---|---|---|---|---|
| Auth UserAccount snake_case 契约漏映射导致管理员入口隐藏 | done | 2026-09-13 | 2026-09-13 | high |
Auth UserAccount snake_case 契约漏映射导致管理员入口隐藏
现象
真实浏览器 UI-00(Antigravity):管理员登录后左侧「系统管理」入口不可见,无法开通 A/B 账号。控制台侧 currentUser.roleId 为 undefined(服务端实际返回 role_id: "role-admin")。
根因分析
- Go
auth.UserAccountJSON 标签为 snake_case:role_id/employee_id/must_change_password/created_at/updated_at。 - 前端
AuthClient将 login / me / admin users 响应直接当作 camelCaseUserAccount使用,未在 API 边界映射。 - 既有单测使用内存
auth.local或驼峰假响应,未覆盖真实 wire 契约,故漏检。 BootstrapAdminFromConfig对已存在非 admin 账号调用UpdateUserRole时静默忽略错误(_, _ =),可能留下非role-admin管理员配置账号。
严重度
high
关联整改
- Short-term: ../ops/short-term/2026-09-13-document-revision-runtime.md
- Checklist: ../ops/checklists/2026-09-13-document-revision-runtime-ui-acceptance.md
证据
- UI-00 实战:管理员登录后无系统管理入口(roleId undefined)
internal/auth/models.goUserAccount json tagsweb/src/api/auth.ts原直接resp.json()赋给 UserAccount
开放问题
- 无(映射层 + bootstrap 错误上浮已落地;占槽后需重跑 UI-00 验证管理员入口)