From d8dbd10389e30a1a7d9aaa993300c3fa94d5b655 Mon Sep 17 00:00:00 2001 From: mtvpls Date: Tue, 27 Jan 2026 09:25:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=A6=E6=88=AA=E8=BF=87=E6=BB=A4=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=99=BB=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TokenRefreshManager.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/TokenRefreshManager.tsx b/src/components/TokenRefreshManager.tsx index 06e883d..28fe0f7 100644 --- a/src/components/TokenRefreshManager.tsx +++ b/src/components/TokenRefreshManager.tsx @@ -99,10 +99,17 @@ export function TokenRefreshManager() { // 拦截 fetch window.fetch = async (input: RequestInfo | URL, init?: RequestInit): Promise => { - // 跳过刷新 API 本身 + // 跳过不需要 Token 刷新的 API const url = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url; - if (url.includes('/api/auth/refresh')) { + // 跳过:刷新 API、登录、登出、注册等认证相关接口 + if ( + url.includes('/api/auth/refresh') || + url.includes('/api/login') || + url.includes('/api/logout') || + url.includes('/api/register') || + url.includes('/api/auth/oidc') + ) { return originalFetch(input, init); }