admin_new P0+P1 全批次合并 (84 commits) #2

Merged
direv merged 85 commits from develop into main 2026-08-07 11:27:17 +08:00
Showing only changes of commit 9837d9fb41 - Show all commits

View File

@ -41,9 +41,13 @@ 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
// 业务级 code:401 (如 /openapi/** 带 token 时 Spring Security 返未授权)
// 不清 token 不跳登录,只 reject 给调用方处理
// 真正的 token 过期走 error 拦截器 (HTTP status 401)
// 业务级 code:401
// 未登录(无 token)访问受保护接口(如 /sys/menu/nav)→ 跳登录页
// 已登录但权限不足(如 /openapi/** 带 token 被 Spring Security 拒)→ 保持 reject 给调用方
if (body.code === 401 && !localStorage.getItem(STORAGE_KEY)) {
handleAuthExpired()
return Promise.reject(body)
}
return Promise.reject(body)
}
return response