From 399e6b9d8cd2d2228613b6a9927529eebbd94786 Mon Sep 17 00:00:00 2001 From: shaw Date: Mon, 8 Sep 2025 16:13:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96codex=20429=E9=99=90?= =?UTF-8?q?=E6=B5=81=E6=98=BE=E7=A4=BA=E4=B8=BA=E6=81=A9=E6=9B=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/claudeAccountService.js | 19 ------------------- web/admin-spa/src/views/AccountsView.vue | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/services/claudeAccountService.js b/src/services/claudeAccountService.js index 354e5df3..336e8828 100644 --- a/src/services/claudeAccountService.js +++ b/src/services/claudeAccountService.js @@ -1181,25 +1181,6 @@ class ClaudeAccountService { `✅ Rate limit removed for account: ${accountData.name} (${accountId}), schedulable restored` ) - // 发送 Webhook 通知限流已解除 - try { - const webhookNotifier = require('../utils/webhookNotifier') - await webhookNotifier.sendAccountAnomalyNotification({ - accountId, - accountName: accountData.name || 'Claude Account', - platform: 'claude-oauth', - status: 'recovered', - errorCode: 'CLAUDE_OAUTH_RATE_LIMIT_CLEARED', - reason: 'Rate limit has been cleared and account is now schedulable', - timestamp: getISOStringWithTimezone(new Date()) - }) - logger.info( - `📢 Webhook notification sent for Claude account ${accountData.name} rate limit cleared` - ) - } catch (webhookError) { - logger.error('Failed to send rate limit cleared webhook notification:', webhookError) - } - return { success: true } } catch (error) { logger.error(`❌ Failed to remove rate limit for account: ${accountId}`, error) diff --git a/web/admin-spa/src/views/AccountsView.vue b/web/admin-spa/src/views/AccountsView.vue index 4e09bc73..7c1d4613 100644 --- a/web/admin-spa/src/views/AccountsView.vue +++ b/web/admin-spa/src/views/AccountsView.vue @@ -1735,6 +1735,23 @@ const getSchedulableReason = (account) => { } } + // OpenAI 账户的错误状态 + if (account.platform === 'openai') { + if (account.status === 'unauthorized') { + return '认证失败(401错误)' + } + // 检查限流状态 - 兼容嵌套的 rateLimitStatus 对象 + if ( + (account.rateLimitStatus && account.rateLimitStatus.isRateLimited) || + account.isRateLimited + ) { + return '触发限流(429错误)' + } + if (account.status === 'error' && account.errorMessage) { + return account.errorMessage + } + } + // 通用原因 if (account.stoppedReason) { return account.stoppedReason