Files
nofx/api
ZhouYongyou 04419b47e6 fix: 修复编辑交易员时「AI模型配置不存在或未启用」错误
问题:
- 编辑交易员并修改系统提示词模板时,保存失败
- 错误提示:AI模型配置不存在或未启用

根本原因:
1. 后端 API 返回的 ai_model 被截断(admin_deepseek → deepseek)
2. 前端验证时找不到对应的模型 ID(enabledModels 存的是完整 ID)
3. API 缺少 system_prompt_template 字段

修复内容:
- api/server.go: 移除 AI model ID 截断逻辑,返回完整 ID
- api/server.go: 在 handleGetTraderConfig 中添加 system_prompt_template 字段
- web/src/types.ts: TraderConfigData 接口添加 system_prompt_template 字段
- web/src/components/AITradersPage.tsx: 添加 fallback 机制和详细日志

测试:
- 编辑交易员 → 修改系统提示词模板 → 保存成功
- Console 输出验证日志,不再报错
2025-11-02 04:51:30 +08:00
..