feat: 文件夹树形列表实现

This commit is contained in:
zhengkunwang223
2022-08-24 17:34:21 +08:00
parent 58ea83c030
commit 8faff6d386
8 changed files with 121 additions and 73 deletions

View File

@@ -1,5 +1,5 @@
import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
import { showFullScreenLoading, tryHideFullScreenLoading } from '@/config/service-loading';
// import { showFullScreenLoading, tryHideFullScreenLoading } from '@/config/service-loading';
import { AxiosCanceler } from './helper/axios-cancel';
import { ResultData } from '@/api/interface';
import { ResultEnum } from '@/enums/http-enum';
@@ -31,7 +31,7 @@ class RequestHttp {
};
}
axiosCanceler.addPending(config);
config.headers!.noLoading || showFullScreenLoading();
// config.headers!.noLoading || showFullScreenLoading();
return {
...config,
};
@@ -48,7 +48,7 @@ class RequestHttp {
globalStore.setCsrfToken(response.headers['x-csrf-token']);
}
axiosCanceler.removePending(config);
tryHideFullScreenLoading();
// tryHideFullScreenLoading();
if (data.code == ResultEnum.OVERDUE || data.code == ResultEnum.FORBIDDEN) {
ElMessage.error(data.msg);
router.replace({
@@ -64,7 +64,7 @@ class RequestHttp {
},
async (error: AxiosError) => {
const { response } = error;
tryHideFullScreenLoading();
// tryHideFullScreenLoading();
if (error.message.indexOf('timeout') !== -1) ElMessage.error('请求超时请您稍后重试');
if (response) checkStatus(response.status);
if (!window.navigator.onLine) router.replace({ path: '/500' });