|
@@ -92,28 +92,28 @@ service.interceptors.response.use(
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
// 登录过期处理
|
|
// 登录过期处理
|
|
|
- // if (error?.response?.status === 401) {
|
|
|
|
|
- // const currentPath = router.currentRoute.path;
|
|
|
|
|
- // if (currentPath === LAYOUT_PATH) {
|
|
|
|
|
- // logout(true);
|
|
|
|
|
- // } else {
|
|
|
|
|
- // MessageBox.alert('登录状态已过期, 请退出重新登录!', '系统提示', {
|
|
|
|
|
- // confirmButtonText: '重新登录',
|
|
|
|
|
- // callback: (action) => {
|
|
|
|
|
- // if (action === 'confirm') {
|
|
|
|
|
- // logout(false, currentPath);
|
|
|
|
|
- // }
|
|
|
|
|
- // },
|
|
|
|
|
- // beforeClose: () => {
|
|
|
|
|
- // MessageBox.close();
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
- // }
|
|
|
|
|
- // return Promise.reject(new Error(error.response.data?.message));
|
|
|
|
|
- // } else if (!error?.response?.status) {
|
|
|
|
|
- // Message.error('服务调用失败,请联系管理员!');
|
|
|
|
|
- // }
|
|
|
|
|
- // return Promise.reject(error);
|
|
|
|
|
|
|
+ if (error?.response?.status === 401) {
|
|
|
|
|
+ const currentPath = router.currentRoute.path;
|
|
|
|
|
+ if (currentPath === LAYOUT_PATH) {
|
|
|
|
|
+ logout(true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ MessageBox.alert('登录状态已过期, 请退出重新登录!', '系统提示', {
|
|
|
|
|
+ confirmButtonText: '重新登录',
|
|
|
|
|
+ callback: (action) => {
|
|
|
|
|
+ if (action === 'confirm') {
|
|
|
|
|
+ logout(false, currentPath);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ beforeClose: () => {
|
|
|
|
|
+ MessageBox.close();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ return Promise.reject(new Error(error.response.data?.message));
|
|
|
|
|
+ } else if (!error?.response?.status) {
|
|
|
|
|
+ Message.error('服务调用失败,请联系管理员!');
|
|
|
|
|
+ }
|
|
|
|
|
+ return Promise.reject(error);
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
|
|
|