diff --git a/src/utils/request.ts b/src/utils/request.ts index 05a85e5..a266529 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -39,12 +39,9 @@ http.interceptors.response.use( const body = response.data as ApiEnvelope | undefined if (body && typeof body === 'object' && 'code' in body) { if (body.code === 0) return response - // 业务错:401 token 过期 / 其它业务错 - if (body.code === 401 || body.code === 401000) { - handleAuthExpired() - return Promise.reject(body) - } - // 业务错(不弹 toast,留给调用方决定) + // 业务级 code:401 (如 /openapi/** 带 token 时 Spring Security 返未授权) + // 不清 token 不跳登录,只 reject 给调用方处理 + // 真正的 token 过期走 error 拦截器 (HTTP status 401) return Promise.reject(body) } return response