release: v2.2.5 [2026-06-10 12:41:11]

### 修复
- **翰林院(RAG)API Key 污染**:
  - 修复 `saveSettingsFromUI` 无差别遍历翰林院面板内全部 `[data-setting-key]` 输入(包含被 `profile-sync` 接管隐藏的字段),导致掩码占位符 `••••••••` 被当作真值写回 `settings.rerank.apiKey` / `settings.retrieval.apiKey`,URL / model 也被 Profile 值覆盖到 legacy 字段。修复后会跳过祖先带 `data-profile-hidden` 的输入
  - `getRerankSettings` / `getEmbedRetrievalSettings` 同时加入防御性还原:识别历史污染留下的 `••••••••` 时归为空字符串,避免取消 Profile 分配后实际请求带占位符 token 被 401
---
This commit is contained in:
Jenkins CI
2026-06-10 12:41:11 +08:00
parent 347016d5ac
commit 1a4a10d42d
15 changed files with 412 additions and 25 deletions

View File

@@ -706,6 +706,11 @@ function saveSettingsFromUI(isAutoSave = true) {
const key = target.dataset.settingKey;
if (!key) return;
// 被 profile-sync 接管的字段(祖先元素带 data-profile-hidden会被填充
// MASKED_KEY 占位符并隐藏,若一并写回会污染 settings.{rerank,retrieval}.apiKey
// 等字段为 '••••••••',导致取消 Profile 分配后实际请求带占位符 token 被 401。
if (target.closest('[data-profile-hidden]')) return;
let value;
const type = target.dataset.type || 'string';