docs(ai): TestConfig key 解析注释精确化(仅注释,无逻辑变更)
CI / Backend (go vet + test) (push) Waiting to run
CI / Frontend (lint + build + test) (push) Waiting to run

This commit is contained in:
opsx committed 2026-11-01 02:01:37 +08:00
1 parent 550d8f4967
commit 02c1ee8aa8
1 file changed
+1 -1
+1 -1
View File
@@ -57,7 +57,7 @@ func (ctrl *AIController) TestConfig(c *gin.Context) {
if req.Model != "" { if req.Model != "" {
cfg.Model = req.Model cfg.Model = req.Model
} }
// 传了新的 key 就用新的(掩码/空则沿用已保存的) // key 解析:传新值才覆盖;掩码/空一律沿用已保存的真实 key(GetAIConfig 返回的是解密后的真值)
if req.APIKey != "" && !containsMask(req.APIKey) { if req.APIKey != "" && !containsMask(req.APIKey) {
cfg.APIKey = req.APIKey cfg.APIKey = req.APIKey
} }