From e29f61aa684741efb7689961b71892451ea9993e Mon Sep 17 00:00:00 2001 From: xiezhouwei Date: Wed, 17 Jun 2026 11:25:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=84=E6=B5=8B=E9=A1=B5=E9=9D=A2=204?= =?UTF-8?q?01=20=E6=8B=A6=E6=88=AA=E5=99=A8=E5=AF=BC=E8=87=B4=E6=9C=AA?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=94=A8=E6=88=B7=E8=A2=AB=E9=87=8D=E5=AE=9A?= =?UTF-8?q?=E5=90=91=E5=88=B0=E7=99=BB=E5=BD=95=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:Benchmarks 页面加载时调用 API.get('/api/option/'), 未登录用户返回 401 → axios 拦截器 → showError() → window.location.href = '/login' 修复:添加 skipErrorHandler: true 参数,跳过全局错误拦截, API 失败时静默回退到离线默认数据 --- web/src/pages/Benchmarks/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/pages/Benchmarks/index.jsx b/web/src/pages/Benchmarks/index.jsx index ff74f1a..2702ac7 100644 --- a/web/src/pages/Benchmarks/index.jsx +++ b/web/src/pages/Benchmarks/index.jsx @@ -98,7 +98,7 @@ const Benchmarks = () => { // Try to fetch backend data in background (async () => { try { - const res = await API.get('/api/option/'); + const res = await API.get('/api/option/', { skipErrorHandler: true }); if (res.data?.success && res.data?.data) { const option = res.data.data.find((o) => o.key === 'benchmark_data.models'); if (option?.value) {