mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
fix: 修复 Gemini token 刷新测试脚本的逻辑问题
- 移除错误的 refreshToken 占位符判断 - 直接使用 getAccount 获取解密后的完整账户信息 - 只有真正没有 refresh token 时才跳过测试 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -39,22 +39,18 @@ async function testGeminiTokenRefresh() {
|
||||
for (const account of geminiAccounts) {
|
||||
console.log(`\n📋 测试账户: ${account.name} (${account.id})`);
|
||||
console.log(` 状态: ${account.status}`);
|
||||
console.log(` 是否有 refresh token: ${account.refreshToken ? '是' : '否'}`);
|
||||
|
||||
if (!account.refreshToken || account.refreshToken === '[ENCRYPTED]') {
|
||||
console.log(' ⚠️ 跳过:无 refresh token\n');
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
// 获取完整账户信息(包括解密的 token)
|
||||
const fullAccount = await geminiAccountService.getAccount(account.id);
|
||||
|
||||
if (!fullAccount.refreshToken) {
|
||||
console.log(' ⚠️ 跳过:无法获取 refresh token\n');
|
||||
console.log(' ⚠️ 跳过:该账户无 refresh token\n');
|
||||
continue;
|
||||
}
|
||||
|
||||
console.log(` ✅ 找到 refresh token`)
|
||||
|
||||
console.log(' 🔄 开始刷新 token...');
|
||||
const startTime = Date.now();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user