Migrate legacy AI and speech settings to backend
- Add a super-admin-only settings merge that copies legacy local AI provider keys into an empty backend settings record. - Add matching migration for legacy Xunfei APPID, APIKey, and APISecret without overwriting existing backend secrets. - Cover the migration and secret-preservation behavior with SystemSettings unit tests. - Update feature, module, progress, and testing docs for the settings migration behavior.
This commit is contained in:
@@ -38,10 +38,14 @@
|
||||
|
||||
系统通过后端 `/api/ai/models` 测试连接和获取模型列表,通过 `/api/ai/chat` 在报告编辑器中生成内容。后端读取全局共用 Provider Key 并代理 OpenAI 兼容 `/models` 与 `/chat/completions`,普通用户读取设置时不会拿到 AI Key。
|
||||
|
||||
从旧前端 mock 版本迁移时,如果超级管理员浏览器的 `localStorage.systemSettings` 中仍保留旧 AI Key,而后端全局配置为空,设置页会在读取后端配置后把本地旧密钥合并到当前设置并自动写入后端。该逻辑只用于迁移已有浏览器缓存;源码、文档和 Docker 配置仍不内置真实密钥。
|
||||
|
||||
## 讯飞语音配置
|
||||
|
||||
`xfSpeechConfig` 保存讯飞 WebSocket IAT 所需的 APPID、APIKey 和 APISecret。报告编辑器只连接本系统 `/api/speech/iat`,由后端读取这些配置、生成讯飞鉴权 URL 并转发音频和识别结果。普通用户读取设置时不会拿到 APIKey/APISecret。
|
||||
|
||||
讯飞配置同样支持从旧本地 `xfSpeechConfig` 向后端 Settings API 做一次性迁移。迁移成功后,医生端语音听写只依赖后端代理和登录 Session。
|
||||
|
||||
## 默认模板
|
||||
|
||||
`defaultTemplate` 指向模板 ID。新建报告时,如果当前用户可见该模板,编辑器会自动加载对应模板内容;否则回退到默认内置报告内容。
|
||||
|
||||
Reference in New Issue
Block a user