mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
fix: 修复OpenAI账户统计问题
- 添加缺失的recordUsage方法,统一updateAccountUsage实现 - 优化模型支持检查逻辑,未设置supportedModels时支持所有模型 - 修复gpt-5模型请求被拒绝的问题 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -135,7 +135,8 @@ class UnifiedOpenAIScheduler {
|
||||
if (boundAccount && boundAccount.isActive === 'true' && boundAccount.status !== 'error') {
|
||||
const isRateLimited = await this.isAccountRateLimited(boundAccount.id)
|
||||
if (!isRateLimited) {
|
||||
// 检查模型支持
|
||||
// 检查模型支持(仅在明确设置了supportedModels且不为空时才检查)
|
||||
// 如果没有设置supportedModels或为空数组,则支持所有模型
|
||||
if (
|
||||
requestedModel &&
|
||||
boundAccount.supportedModels &&
|
||||
@@ -188,7 +189,8 @@ class UnifiedOpenAIScheduler {
|
||||
continue
|
||||
}
|
||||
|
||||
// 检查模型支持
|
||||
// 检查模型支持(仅在明确设置了supportedModels且不为空时才检查)
|
||||
// 如果没有设置supportedModels或为空数组,则支持所有模型
|
||||
if (requestedModel && account.supportedModels && account.supportedModels.length > 0) {
|
||||
const modelSupported = account.supportedModels.includes(requestedModel)
|
||||
if (!modelSupported) {
|
||||
@@ -414,7 +416,8 @@ class UnifiedOpenAIScheduler {
|
||||
continue
|
||||
}
|
||||
|
||||
// 检查模型支持
|
||||
// 检查模型支持(仅在明确设置了supportedModels且不为空时才检查)
|
||||
// 如果没有设置supportedModels或为空数组,则支持所有模型
|
||||
if (requestedModel && account.supportedModels && account.supportedModels.length > 0) {
|
||||
const modelSupported = account.supportedModels.includes(requestedModel)
|
||||
if (!modelSupported) {
|
||||
|
||||
Reference in New Issue
Block a user