|
@@ -7,6 +7,7 @@ import store from "./store";
|
|
|
import globalVuePlugins from "./plugins/globalVuePlugins";
|
|
|
import GLOBAL from "./config";
|
|
|
import { jsonBigNumberToString } from "./plugins/utils";
|
|
|
+
|
|
|
|
|
|
|
|
|
import VueLocalStorage from "vue-ls";
|
|
@@ -26,17 +27,6 @@ router.beforeEach((to, from, next) => {
|
|
|
const token = Vue.ls.get("token");
|
|
|
if (to.meta.noRequire) {
|
|
|
next();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
} else {
|
|
|
|
|
|
if (token) {
|
|
@@ -60,6 +50,8 @@ axios.defaults.transformResponse = [
|
|
|
return JSON.parse(jsonBigNumberToString(data));
|
|
|
}
|
|
|
];
|
|
|
+
|
|
|
+axios.defaults.timeout = GLOBAL.timeout;
|
|
|
axios.interceptors.request.use(
|
|
|
config => {
|
|
|
|
|
@@ -72,19 +64,27 @@ axios.interceptors.request.use(
|
|
|
}
|
|
|
queue.push(1);
|
|
|
|
|
|
-
|
|
|
- if (config.url.indexOf("http://") < 0) {
|
|
|
- config.url = GLOBAL.domain + config.url;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
let token = Vue.ls.get("token");
|
|
|
if (token) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
config.headers["token"] = token;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- config.timeout = GLOBAL.timeout;
|
|
|
return config;
|
|
|
},
|
|
|
error => {
|