|
@@ -2,6 +2,7 @@ import axios from 'axios'
|
|
|
import VueAxios from 'vue-axios'
|
|
|
import Vue from 'vue'
|
|
|
import router from '../router'
|
|
|
+import store from '../store'
|
|
|
import ElementUI, {
|
|
|
Loading
|
|
|
} from 'element-ui';
|
|
@@ -42,7 +43,7 @@ Vue.use(VueAxios, axios);
|
|
|
axios.defaults.baseURL = '';
|
|
|
axios.defaults.headers.common['Authorization'] = "";
|
|
|
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
|
-axios.defaults.timeout = 1000 * 48;
|
|
|
+axios.defaults.timeout = 1000 * 60;
|
|
|
axios.defaults.withCredentials = true;
|
|
|
let isInvalid1 = false
|
|
|
let isInvalid2 = false
|
|
@@ -52,6 +53,16 @@ axios.interceptors.request.use(function (config) {
|
|
|
|
|
|
|
|
|
config.headers.common['Authorization'] = localStorage.getItem('Authorization');
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (store.state.username &&
|
|
|
+ localStorage.getItem('username') &&
|
|
|
+ store.state.username != localStorage.getItem('username')) {
|
|
|
+ window.location.reload();
|
|
|
+ }
|
|
|
+
|
|
|
if (config.noLoading === true) {
|
|
|
console.log("noLoading");
|
|
|
} else {
|
|
@@ -116,7 +127,7 @@ const instance = axios.create({
|
|
|
|
|
|
instance.defaults.headers.common['Authorization'] = "";
|
|
|
instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
|
-instance.defaults.timeout = 1000 * 60 * 3;
|
|
|
+instance.defaults.timeout = 1000 * 60 * 6;
|
|
|
instance.defaults.withCredentials = true;
|
|
|
|
|
|
instance.interceptors.request.use(function (config) {
|