fix: 解决文件切换菜单导致退出的BUG

This commit is contained in:
zhengkunwang223
2023-03-02 10:45:37 +08:00
committed by zhengkunwang223
parent 651c269041
commit a9aa1d386f
2 changed files with 6 additions and 2 deletions

View File

@@ -79,7 +79,12 @@ class RequestHttp {
async (error: AxiosError) => {
const { response } = error;
if (error.message.indexOf('timeout') !== -1) MsgError('请求超时请您稍后重试');
if (response) checkStatus(response.status, response.data['message']);
if (response) {
checkStatus(
response.status,
response.data && response.data['message'] ? response.data['message'] : '',
);
}
if (!window.navigator.onLine) router.replace({ path: '/500' });
return Promise.reject(error);
},