|
@@ -4,6 +4,7 @@ import store from '@/store'
|
|
import {getToken} from '@/utils/auth'
|
|
import {getToken} from '@/utils/auth'
|
|
|
|
|
|
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
|
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
|
|
|
+let loading;
|
|
|
|
|
|
// create an axios instance
|
|
// create an axios instance
|
|
const service = axios.create({
|
|
const service = axios.create({
|
|
@@ -12,7 +13,6 @@ const service = axios.create({
|
|
timeout: 5000 // request timeout
|
|
timeout: 5000 // request timeout
|
|
})
|
|
})
|
|
|
|
|
|
-let loading;
|
|
|
|
// request interceptor
|
|
// request interceptor
|
|
service.interceptors.request.use(
|
|
service.interceptors.request.use(
|
|
config => {
|
|
config => {
|
|
@@ -24,7 +24,6 @@ service.interceptors.request.use(
|
|
// please modify it according to the actual situation
|
|
// please modify it according to the actual situation
|
|
config.headers['satoken'] = getToken();
|
|
config.headers['satoken'] = getToken();
|
|
}
|
|
}
|
|
-
|
|
|
|
loading = Loading.service({
|
|
loading = Loading.service({
|
|
lock: true,
|
|
lock: true,
|
|
text: '数据请求中.....',
|
|
text: '数据请求中.....',
|