Add demo mode factory reset

- Align the backend seeded default surgery template with the report editor's default report content.

- Add backend demo defaults for the default template, Kimi provider, and Xunfei speech proxy configuration.

- Change system reset into a super-admin demo mode factory reset that clears reports, audit logs, files, custom templates, and non-default users.

- Keep only the default admin, manager, doctor, and default surgery template after demo reset.

- Replace the old local-only reset all data button with a two-confirmation backend reset flow.

- Add tests covering demo default alignment and database-backed demo reset behavior.

- Update docs to describe demo mode reset semantics and production credential cautions.
This commit is contained in:
2026-05-02 02:52:30 +08:00
parent bc235b2358
commit 911b96b883
17 changed files with 361 additions and 85 deletions

View File

@@ -248,6 +248,7 @@ docker-compose down
- 权限判断主要在前端,不能作为生产安全边界。
- 报告和模板 HTML 保存时已做服务端白名单清洗,但渲染仍使用 HTML需要继续做安全评审。
- AI Key 和讯飞语音密钥已由后端代理使用;普通用户读取设置时不会拿到真实密钥。
- 当前 demo mode 后端默认值包含演示用第三方服务凭据,生产部署前必须替换或移除,并轮换曾经暴露过的密钥。
- 视频和关键帧已优先上传后端文件资源,报告保存时通过 `ReportMedia` 关系表关联;新建报告保存前仍依赖本地预览对象。
生产化方向见 [docs/backendization-plan.md](./docs/backendization-plan.md)。