同步更新:重构路由、服务模块,更新前端构建
This commit is contained in:
@@ -25,7 +25,11 @@ api.interceptors.response.use(
|
||||
const payload = error?.response?.data
|
||||
const message = payload?.error || payload?.message || error?.message || '请求失败'
|
||||
|
||||
if (status === 403) {
|
||||
if (status === 401) {
|
||||
toastErrorOnce('401', message || '登录已过期,请重新登录', 3000)
|
||||
const pathname = window.location?.pathname || ''
|
||||
if (!pathname.startsWith('/yuyx')) window.location.href = '/yuyx'
|
||||
} else if (status === 403) {
|
||||
toastErrorOnce('403', message || '需要管理员权限', 5000)
|
||||
} else if (status) {
|
||||
toastErrorOnce(`http:${status}:${message}`, message)
|
||||
|
||||
Reference in New Issue
Block a user