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

@@ -50,7 +50,7 @@
- 报告保存为草稿或完成态时优先写入后端;开发回退开启时会同步 `reports` 缓存API 不可用时才写入本地 `reports`
- 新建报告成功保存后会清理当前用户草稿。
- 编辑已有报告时会把旧内容推入 `history`
- 开发回退模式下,系统设置页“重置全部数据”会执行 `localStorage.clear()` 并刷新页面;生产构建默认阻止把该操作误认为后端数据重置
- 系统设置页“恢复演示出厂设置”会调用后端 `POST /api/settings/system/reset` 恢复 demo mode并在成功后清理当前浏览器缓存再刷新页面
## 迁移注意