|
@@ -4,7 +4,7 @@ import type { AxiosInstance, AxiosError, AxiosRequestConfig, InternalAxiosReques
|
|
|
import { ElMessage, ElNotification } from 'element-plus'
|
|
|
import { ResultEnum, ResultData, ContentType } from './interface/index'
|
|
|
import {diffhost } from './diffhost/index'
|
|
|
-
|
|
|
+import { loadingFun, closeFun } from "@/plugins/loading";
|
|
|
import router from '@/router/index'
|
|
|
type LoadingType = {
|
|
|
close?: () => void
|
|
@@ -36,6 +36,7 @@ class RequestHttp {
|
|
|
*/
|
|
|
|
|
|
this.service.interceptors.request.use((config: InternalAxiosRequestConfig) => {
|
|
|
+ loadingFun()
|
|
|
config.headers.Authorization = 'Bearer '+sessionStorage.getItem('token')
|
|
|
const host = diffhost(config)
|
|
|
const url1 = process.env.VUE_APP_BASE_URL1
|
|
@@ -97,6 +98,9 @@ class RequestHttp {
|
|
|
ElMessage.error(params.msg)
|
|
|
break;
|
|
|
}
|
|
|
+ setTimeout(() => {
|
|
|
+ closeFun()
|
|
|
+ }, 500);
|
|
|
}
|
|
|
}
|
|
|
// * 常用请求方法封装
|