Fixes: Gemini账户调度状态在页面刷新后与实际设置不符

This commit is contained in:
wt
2025-08-11 16:48:34 +08:00
parent 3316fb7072
commit 0f66ea7d4a
2 changed files with 21 additions and 5 deletions

View File

@@ -363,6 +363,9 @@ async function getAccount(accountId) {
}
}
// 转换 schedulable 字符串为布尔值(与 claudeConsoleAccountService 保持一致)
accountData.schedulable = accountData.schedulable !== 'false' // 默认为true只有明确设置为'false'才为false
return accountData
}
@@ -386,6 +389,11 @@ async function updateAccount(accountId, updates) {
updates.proxy = updates.proxy ? JSON.stringify(updates.proxy) : ''
}
// 处理 schedulable 字段,确保正确转换为字符串存储
if (updates.schedulable !== undefined) {
updates.schedulable = updates.schedulable.toString()
}
// 加密敏感字段
if (updates.geminiOauth) {
updates.geminiOauth = encrypt(
@@ -517,6 +525,9 @@ async function getAllAccounts() {
}
}
// 转换 schedulable 字符串为布尔值(与 getAccount 保持一致)
accountData.schedulable = accountData.schedulable !== 'false' // 默认为true只有明确设置为'false'才为false
// 不解密敏感字段,只返回基本信息
accounts.push({
...accountData,