Add audit log UI and backend API seeded E2E
- Add Auth Context route role guards so doctors cannot directly enter template management, user management, or audit logs. - Add Audit Logs page, sidebar entry, frontend audit API client, and API client test. - Add backend audit log query endpoint with super/admin visibility rules and query filtering. - Extend PostgreSQL integration tests to cover audit log query permissions. - Move Playwright E2E away from localStorage seed data to real backend API login and seed helpers. - Add E2E coverage for route guards and audit log visibility. - Run Playwright backend on port 3100 and proxy Vite API requests there to avoid local port conflicts. - Make server:dev use the compiled NestJS server path, avoiding tsx parameter-property injection issues. - Update README, AGENTS, feature, testing, security, deployment, progress, API, backendization, and auth/user module docs.
This commit is contained in:
@@ -80,14 +80,14 @@ npm run prisma:seed
|
||||
| `manager` | `123456` | 管理员 |
|
||||
| `0001` | `123456` | 医生 |
|
||||
|
||||
开发模式下,默认数据会在首次进入登录页时初始化到浏览器 `localStorage`,用于离线回退和旧 E2E 基线。
|
||||
开发模式下,默认数据会在首次进入登录页时初始化到浏览器 `localStorage`,用于离线回退和旧数据兼容;当前 Playwright E2E 已改为真实后端 API seed。
|
||||
账号认证由后端 `POST /api/auth/login` 完成;登录成功后前端会同步一份 `currentUser` 到 `localStorage`,供迁移期页面继续读取角色、部门和模板权限。生产构建默认不通过本地缓存恢复登录态。
|
||||
|
||||
## 常用命令
|
||||
|
||||
```bash
|
||||
npm run dev # 启动开发服务器,端口 3001
|
||||
npm run server:dev # 启动 NestJS API,端口 3000
|
||||
npm run server:dev # 编译并启动 NestJS API,默认端口 3000
|
||||
npm run server:build # 构建后端 TypeScript
|
||||
npm run lint # TypeScript 类型检查
|
||||
npm run test # Vitest 测试
|
||||
@@ -239,7 +239,7 @@ docker-compose down
|
||||
## 当前限制
|
||||
|
||||
- 前端登录、工作台统计、报告读写、报告媒体引用、模板读写、字段库、模板图片资源、视频/关键帧文件、用户管理、部门模板授权、系统设置、签名文件、AI 对话和语音听写已接入真实后端 Session/API/代理。
|
||||
- 当前后端已有认证、数据库 Session、健康检查、Dashboard API、报告 API、模板 API、字段库 API、通用文件 API、用户/部门 API、设置 API、签名文件 API、AI 代理、语音代理、权限策略、HTML 清洗、审计日志和数据模型。
|
||||
- 当前后端已有认证、数据库 Session、健康检查、Dashboard API、报告 API、模板 API、字段库 API、通用文件 API、用户/部门 API、设置 API、签名文件 API、AI 代理、语音代理、权限策略、HTML 清洗、审计日志查询和数据模型。
|
||||
- 后端账号使用 Argon2 哈希;开发模式前端仍会初始化 `localStorage.users`,其中保留演示密码字段供旧页面兼容。
|
||||
- 权限判断主要在前端,不能作为生产安全边界。
|
||||
- 报告和模板 HTML 保存时已做服务端白名单清洗,但渲染仍使用 HTML,需要继续做安全评审。
|
||||
|
||||
Reference in New Issue
Block a user