From 74128f53a54aa5c3124c86e04841aaccc2620819 Mon Sep 17 00:00:00 2001 From: zhulianghu Date: Wed, 1 Apr 2026 09:53:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E6=8B=A6=E6=88=AA=E5=99=A8=20code=3D0=20=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/axios/service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index dfaea75d6..04ed3a51b 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -145,7 +145,7 @@ service.interceptors.response.use( } data = await new Response(response.data).json() } - const code = data.code || result_code + const code = data.code ?? result_code // 获取错误信息 const msg = data.msg || errorCode[code] || errorCode['default'] if (ignoreMsgs.indexOf(msg) !== -1) { @@ -211,7 +211,7 @@ service.interceptors.response.use( '
5 分钟搭建本地环境
' }) return Promise.reject(new Error(msg)) - } else if (code !== 200) { + } else if (code !== 0 && code !== 200) { if (msg === '无效的刷新令牌') { // hard coding:忽略这个提示,直接登出 console.log(msg)