From a6967240c7e5a4f394925643fc9a0161a8a50ec6 Mon Sep 17 00:00:00 2001 From: QLHazyCoder <2825305047@qq.com> Date: Wed, 22 Apr 2026 18:19:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=86=20OAuth=20=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E8=AE=BE=E7=BD=AE=E4=BB=8E=206=20=E5=88=86?= =?UTF-8?q?=E9=92=9F=E8=B0=83=E6=95=B4=E4=B8=BA=205=20=E5=88=86=E9=92=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- background.js | 4 ++-- tests/background-auth-chain-guard.test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/background.js b/background.js index 7297909..a07a4d9 100644 --- a/background.js +++ b/background.js @@ -151,7 +151,7 @@ const HUMAN_STEP_DELAY_MIN = 700; const HUMAN_STEP_DELAY_MAX = 2200; const STEP6_MAX_ATTEMPTS = 3; const STEP7_MAIL_POLLING_RECOVERY_MAX_ATTEMPTS = 8; -const OAUTH_FLOW_TIMEOUT_MS = 6 * 60 * 1000; +const OAUTH_FLOW_TIMEOUT_MS = 5 * 60 * 1000; const SUB2API_STEP1_RESPONSE_TIMEOUT_MS = 90000; const SUB2API_STEP9_RESPONSE_TIMEOUT_MS = 120000; const DEFAULT_SUB2API_URL = 'https://sub2api.hisence.fun/admin/accounts'; @@ -6836,7 +6836,7 @@ async function startOAuthFlowTimeoutWindow(options = {}) { oauthFlowDeadlineAt: deadlineAt, oauthFlowDeadlineSourceUrl: normalizeOAuthFlowSourceUrl(options.oauthUrl), }); - await addLog(`步骤 ${step}:已拿到新的 OAuth 登录地址,开始 6 分钟倒计时。`, 'info'); + await addLog(`步骤 ${step}:已拿到新的 OAuth 登录地址,开始 ${Math.round(OAUTH_FLOW_TIMEOUT_MS / 60000)} 分钟倒计时。`, 'info'); return deadlineAt; } diff --git a/tests/background-auth-chain-guard.test.js b/tests/background-auth-chain-guard.test.js index 3fec903..0353613 100644 --- a/tests/background-auth-chain-guard.test.js +++ b/tests/background-auth-chain-guard.test.js @@ -162,7 +162,7 @@ return { test('oauth timeout budget ignores stale deadlines from an old oauth url', async () => { const api = new Function(` const LOG_PREFIX = '[test]'; -const OAUTH_FLOW_TIMEOUT_MS = 6 * 60 * 1000; +const OAUTH_FLOW_TIMEOUT_MS = 5 * 60 * 1000; ${extractFunction('normalizeOAuthFlowDeadlineAt')} ${extractFunction('normalizeOAuthFlowSourceUrl')} ${extractFunction('getOAuthFlowRemainingMs')}