mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
feat: 改进 Gemini token 刷新机制和错误处理
- Token 刷新成功后自动将账户状态更新为 active - 清空之前的错误信息 - 确保账户在成功刷新后可以正常使用 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -622,7 +622,9 @@ async function refreshAccountToken(accountId) {
|
||||
refreshToken: newTokens.refresh_token || account.refreshToken,
|
||||
expiresAt: new Date(newTokens.expiry_date).toISOString(),
|
||||
lastRefreshAt: new Date().toISOString(),
|
||||
geminiOauth: JSON.stringify(newTokens)
|
||||
geminiOauth: JSON.stringify(newTokens),
|
||||
status: 'active', // 刷新成功后,将状态更新为 active
|
||||
errorMessage: '' // 清空错误信息
|
||||
};
|
||||
|
||||
await updateAccount(accountId, updates);
|
||||
|
||||
Reference in New Issue
Block a user