feat: 实现系统管理用户、角色与权限配置页面

补齐 RBAC 相关页面与 UI 设计图,并接入功能与视觉回归测试,便于后续持续验证。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-26 03:08:35 +08:00
parent c4872891f8
commit 77f718965d
24 changed files with 1869 additions and 14 deletions

View File

@@ -19,10 +19,10 @@ docs/ui/
│ ├── usage/ # 用量统计
│ ├── usage-detail/ # 用量明细
│ └── quota/ # 限流与配额
└── system/ # 系统管理(待补图)
├── user/
├── role/
└── permission/
└── system/ # 系统管理
├── user/ # 用户管理(列表 / 表单 / 重置密码)
├── role/ # 角色管理(含权限配置抽屉)
└── permission/ # 权限配置(菜单 / 按钮)
```
---
@@ -43,10 +43,12 @@ docs/ui/
| ├ 用量统计 | `/llm/usage` | [llm/usage/chatone-llm-usage-ui.png](./llm/usage/chatone-llm-usage-ui.png) |
| ├ 用量明细 | `/llm/usage/details` | [llm/usage-detail/chatone-llm-usage-detail-ui.png](./llm/usage-detail/chatone-llm-usage-detail-ui.png) |
| └ 限流配额 | `/llm/quota` | [llm/quota/chatone-llm-quota-ui.png](./llm/quota/chatone-llm-quota-ui.png) |
| **系统管理** | `/system` | 待补 |
| ├ 用户管理 | `/system/user` | `system/user/` |
| ├ 角色管理 | `/system/role` | `system/role/` |
| └ 权限配置 | `/system/permission` | `system/permission/` |
| **系统管理** | `/system` | |
| ├ 用户管理 | `/system/user` | [system/user/chatone-system-user-list-ui.png](./system/user/chatone-system-user-list-ui.png) |
| │ ├ 新增/编辑 | Modal | [system/user/chatone-system-user-form-ui.png](./system/user/chatone-system-user-form-ui.png) |
| │ └ 重置密码 | Modal | [system/user/chatone-system-user-reset-pwd-ui.png](./system/user/chatone-system-user-reset-pwd-ui.png) |
| ├ 角色管理 | `/system/role` | [system/role/chatone-system-role-ui.png](./system/role/chatone-system-role-ui.png) |
| └ 权限配置 | `/system/permission` | [system/permission/chatone-system-permission-ui.png](./system/permission/chatone-system-permission-ui.png) |
---
@@ -92,6 +94,33 @@ docs/ui/
---
## 系统管理:功能清单
### 用户管理 `/system/user`
- 新增 / 编辑 / 删除用户(含批量禁用)
- 启用 / 禁用账号Switch
- 筛选:关键词(用户名 / 邮箱 / 手机)、角色、状态
- 绑定角色(多选)
- 重置密码(临时密码 + 强制下次修改)
- 展示最近登录时间、创建时间
### 角色管理 `/system/role`
- 新增 / 编辑 / 删除角色
- 角色编码(如 `ROLE_ADMIN`)、描述、启停
- 查看关联用户数
- 抽屉配置:菜单树权限 + 按钮权限码
### 权限配置 `/system/permission`
- **菜单权限**:树形维护目录 / 菜单 / 按钮;路由、图标、排序、显示开关、权限标识
- **按钮权限**:权限名称、权限码(如 `user:create`)、所属菜单;供前端 `<Access />` 使用
权限模型RBAC用户 → 角色 → 菜单/按钮权限)。
---
## 建议的菜单 Mock 结构
```ts
@@ -106,5 +135,15 @@ docs/ui/
{ name: '用量明细', path: '/llm/usage/details' },
{ name: '限流配额', path: '/llm/quota' },
],
},
{
name: '系统管理',
path: '/system',
icon: 'SettingOutlined',
children: [
{ name: '用户管理', path: '/system/user' },
{ name: '角色管理', path: '/system/role' },
{ name: '权限配置', path: '/system/permission' },
],
}
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB