mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-30 08:22:34 +00:00
feat(admin): 用户创建/编辑支持选择与修改角色 (user/admin)
- 创建用户时可指定角色,缺省仍为 user,不再硬编码为普通用户 - 编辑用户时可在 user/admin 之间切换角色 - 后端对角色做 admin/user 合法性校验 - 防锁死保护:管理员不能把自己降级为普通用户(与既有"不能禁用/删除 admin"保护一致;降级其他管理员仍允许) - 前端创建/编辑弹窗新增角色下拉,复用既有 i18n 文案 - 新增角色创建/更新/非法值/防降级单元测试 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
0438057c0b
commit
64fdc11ec4
@@ -121,6 +121,7 @@ export async function create(userData: {
|
||||
password: string
|
||||
username?: string
|
||||
notes?: string
|
||||
role?: 'admin' | 'user'
|
||||
balance?: number
|
||||
concurrency?: number
|
||||
rpm_limit?: number
|
||||
|
||||
Reference in New Issue
Block a user