liuyun
6618137da5
feat(auth): 平台超管租户切换(super 标志 + switch-tenant)
...
- JWT 加 super 标志,sub 保持超管真实 userId,tenantCode 随切换
- isSuper 解析/checkUserActive/PermissionsGuard 支持跨租户超管
- POST /auth/switch-tenant
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-12 00:00:38 +08:00
liuyun
f747ad5442
feat(tenant): 租户品牌定制(brand_name/logo_url/theme_color/copyright + GET /auth/brand)
...
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 22:32:14 +08:00
liuyun
6578db51c7
feat(auth): PATCH /auth/me/password 修改本人密码
...
- 校验原密码 + 更新后 tokenVersion 吊销其它会话
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 16:34:51 +08:00
liuyun
53dbc38bab
feat(auth): 注册接口 POST /auth/register
...
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 16:29:11 +08:00
liuyun
78e537fa73
feat(rbac): 用户-角色分配 + 权限码下发接口
...
- users: GET/PUT /users/:id/roles(事务化替换 + 过滤无效角色 + 清权限缓存)
- auth: GET /auth/permissions 返回 {super, permissions}
- permissions/seed: 新增 user:assign-role 权限码与资源
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 16:19:11 +08:00
liuyun
489d7232e3
feat: user list search + current-user menu tree endpoint
...
- GET /auth/menus:当前用户菜单树(超管全量,非超管按角色 + 补祖先)
- 用户列表支持 username/nickname/phone/status 过滤(ListUserQuery)
- seed:菜单补图标、新增「权限管理」顶级分组(用户/角色/资源/组织),dashboard path 修正为 /
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 12:19:42 +08:00
liuyun
7340658305
feat: enforce RBAC, audit/login logging, and seed script
...
收口 Phase 0 三处「声明未生效」:
- 三级鉴权落地:权限集存 Redis(key 前缀隔离多项目),@RequirePermissions 挂到全部受控接口,super_admin 角色绕过权限码与 data_scope
- 审计/登录日志自动落库:@AuditLog 装饰器 + 拦截器异步写入(写操作+登录登出),登录成功/失败均记 login_log(脱敏)
- seed 脚本:一键初始化租户 touyun/用户 touyun/超管 super_admin/全量资源树(48 资源全量授权)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-10 23:19:41 +08:00
liuyun
d8d3055c73
feat: backend foundation (Prisma 6 + MySQL, auth, tenant/soft-delete/data-scope filters, core CRUD)
...
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-10 21:13:35 +08:00