mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
feat: 完善多平台账户管理和API Keys页面展示
- 修复OpenAI路由中的gpt-5模型ID处理 - 增强统一调度器的账户选择日志输出 - 优化OAuth流程中的账户类型处理 - 完善API Keys页面的多平台账户信息展示 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,8 @@ class UnifiedGeminiScheduler {
|
||||
logger.info(
|
||||
`🎯 Using bound dedicated Gemini account: ${boundAccount.name} (${apiKeyData.geminiAccountId}) for API key ${apiKeyData.name}`
|
||||
)
|
||||
// 更新账户的最后使用时间
|
||||
await geminiAccountService.markAccountUsed(apiKeyData.geminiAccountId)
|
||||
return {
|
||||
accountId: apiKeyData.geminiAccountId,
|
||||
accountType: 'gemini'
|
||||
@@ -62,6 +64,8 @@ class UnifiedGeminiScheduler {
|
||||
logger.info(
|
||||
`🎯 Using sticky session account: ${mappedAccount.accountId} (${mappedAccount.accountType}) for session ${sessionHash}`
|
||||
)
|
||||
// 更新账户的最后使用时间
|
||||
await geminiAccountService.markAccountUsed(mappedAccount.accountId)
|
||||
return mappedAccount
|
||||
} else {
|
||||
logger.warn(
|
||||
@@ -108,6 +112,9 @@ class UnifiedGeminiScheduler {
|
||||
`🎯 Selected account: ${selectedAccount.name} (${selectedAccount.accountId}, ${selectedAccount.accountType}) with priority ${selectedAccount.priority} for API key ${apiKeyData.name}`
|
||||
)
|
||||
|
||||
// 更新账户的最后使用时间
|
||||
await geminiAccountService.markAccountUsed(selectedAccount.accountId)
|
||||
|
||||
return {
|
||||
accountId: selectedAccount.accountId,
|
||||
accountType: selectedAccount.accountType
|
||||
@@ -378,6 +385,8 @@ class UnifiedGeminiScheduler {
|
||||
logger.info(
|
||||
`🎯 Using sticky session account from group: ${mappedAccount.accountId} (${mappedAccount.accountType}) for session ${sessionHash}`
|
||||
)
|
||||
// 更新账户的最后使用时间
|
||||
await geminiAccountService.markAccountUsed(mappedAccount.accountId)
|
||||
return mappedAccount
|
||||
}
|
||||
}
|
||||
@@ -473,6 +482,9 @@ class UnifiedGeminiScheduler {
|
||||
`🎯 Selected account from Gemini group ${group.name}: ${selectedAccount.name} (${selectedAccount.accountId}, ${selectedAccount.accountType}) with priority ${selectedAccount.priority}`
|
||||
)
|
||||
|
||||
// 更新账户的最后使用时间
|
||||
await geminiAccountService.markAccountUsed(selectedAccount.accountId)
|
||||
|
||||
return {
|
||||
accountId: selectedAccount.accountId,
|
||||
accountType: selectedAccount.accountType
|
||||
|
||||
@@ -38,6 +38,8 @@ class UnifiedOpenAIScheduler {
|
||||
logger.info(
|
||||
`🎯 Using bound dedicated OpenAI account: ${boundAccount.name} (${apiKeyData.openaiAccountId}) for API key ${apiKeyData.name}`
|
||||
)
|
||||
// 更新账户的最后使用时间
|
||||
await openaiAccountService.recordUsage(apiKeyData.openaiAccountId, 0)
|
||||
return {
|
||||
accountId: apiKeyData.openaiAccountId,
|
||||
accountType: 'openai'
|
||||
@@ -62,6 +64,8 @@ class UnifiedOpenAIScheduler {
|
||||
logger.info(
|
||||
`🎯 Using sticky session account: ${mappedAccount.accountId} (${mappedAccount.accountType}) for session ${sessionHash}`
|
||||
)
|
||||
// 更新账户的最后使用时间
|
||||
await openaiAccountService.recordUsage(mappedAccount.accountId, 0)
|
||||
return mappedAccount
|
||||
} else {
|
||||
logger.warn(
|
||||
@@ -108,6 +112,9 @@ class UnifiedOpenAIScheduler {
|
||||
`🎯 Selected account: ${selectedAccount.name} (${selectedAccount.accountId}, ${selectedAccount.accountType}) with priority ${selectedAccount.priority} for API key ${apiKeyData.name}`
|
||||
)
|
||||
|
||||
// 更新账户的最后使用时间
|
||||
await openaiAccountService.recordUsage(selectedAccount.accountId, 0)
|
||||
|
||||
return {
|
||||
accountId: selectedAccount.accountId,
|
||||
accountType: selectedAccount.accountType
|
||||
@@ -372,6 +379,8 @@ class UnifiedOpenAIScheduler {
|
||||
logger.info(
|
||||
`🎯 Using sticky session account from group: ${mappedAccount.accountId} (${mappedAccount.accountType})`
|
||||
)
|
||||
// 更新账户的最后使用时间
|
||||
await openaiAccountService.recordUsage(mappedAccount.accountId, 0)
|
||||
return mappedAccount
|
||||
}
|
||||
}
|
||||
@@ -459,6 +468,9 @@ class UnifiedOpenAIScheduler {
|
||||
`🎯 Selected account from group: ${selectedAccount.name} (${selectedAccount.accountId}) with priority ${selectedAccount.priority}`
|
||||
)
|
||||
|
||||
// 更新账户的最后使用时间
|
||||
await openaiAccountService.recordUsage(selectedAccount.accountId, 0)
|
||||
|
||||
return {
|
||||
accountId: selectedAccount.accountId,
|
||||
accountType: selectedAccount.accountType
|
||||
|
||||
Reference in New Issue
Block a user