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

@ -69,7 +69,6 @@ declare module 'vue' {
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
FileList: typeof import('./src/components/file-list/index.vue')['default']
FileRole: typeof import('./src/components/file-role/index.vue')['default']

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);
},