This commit is contained in:
Archer
2023-12-11 15:12:14 +08:00
committed by GitHub
parent 84cf6b5658
commit d2d7eac9e0
105 changed files with 1091 additions and 801 deletions

View File

@@ -99,10 +99,14 @@ function responseError(err: any) {
// 有报错响应
if (err?.code in TOKEN_ERROR_CODE) {
clearToken();
window.location.replace(
`/login?lastRoute=${encodeURIComponent(location.pathname + location.search)}`
);
return Promise.reject({ message: 'token过期重新登录' });
if (window.location.pathname !== '/chat/share') {
window.location.replace(
`/login?lastRoute=${encodeURIComponent(location.pathname + location.search)}`
);
}
return Promise.reject({ message: '无权操作' });
}
if (err?.response?.data) {
return Promise.reject(err?.response?.data);