mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 00:53:33 +00:00
Fixes: Gemini账户调度状态在页面刷新后与实际设置不符
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user