|
@@ -25,8 +25,6 @@ Vue.use(globalVuePlugins);
|
|
|
|
|
|
Vue.prototype.GLOBAL = GLOBAL;
|
|
Vue.prototype.GLOBAL = GLOBAL;
|
|
Vue.config.productionTip = false;
|
|
Vue.config.productionTip = false;
|
|
-// const IS_DEV = true;
|
|
|
|
-const IS_DEV = process.env.NODE_ENV === "development";
|
|
|
|
|
|
|
|
// route interceptor
|
|
// route interceptor
|
|
router.beforeEach((to, from, next) => {
|
|
router.beforeEach((to, from, next) => {
|
|
@@ -79,23 +77,18 @@ axios.interceptors.request.use(
|
|
});
|
|
});
|
|
|
|
|
|
// 新版鉴权 to open
|
|
// 新版鉴权 to open
|
|
- if (IS_DEV) {
|
|
|
|
- config.headers["Authorization"] = token;
|
|
|
|
- config.headers["time"] = 1;
|
|
|
|
- } else {
|
|
|
|
- const sessionId = Vue.ls.get("user", { sessionId: "" }).sessionId;
|
|
|
|
- const { Authorization, timestamp } = getAuthorization(
|
|
|
|
- {
|
|
|
|
- token: token,
|
|
|
|
- account: sessionId,
|
|
|
|
- uri: config.url.split("?")[0],
|
|
|
|
- method: config.method
|
|
|
|
- },
|
|
|
|
- "token"
|
|
|
|
- );
|
|
|
|
- config.headers["Authorization"] = Authorization;
|
|
|
|
- config.headers["time"] = timestamp;
|
|
|
|
- }
|
|
|
|
|
|
+ const sessionId = Vue.ls.get("user", { sessionId: "" }).sessionId;
|
|
|
|
+ const { Authorization, timestamp } = getAuthorization(
|
|
|
|
+ {
|
|
|
|
+ token: token,
|
|
|
|
+ account: sessionId,
|
|
|
|
+ uri: config.url.split("?")[0],
|
|
|
|
+ method: config.method
|
|
|
|
+ },
|
|
|
|
+ "token"
|
|
|
|
+ );
|
|
|
|
+ config.headers["Authorization"] = Authorization;
|
|
|
|
+ config.headers["time"] = timestamp;
|
|
}
|
|
}
|
|
config.headers["deviceId"] = DEVICE_ID;
|
|
config.headers["deviceId"] = DEVICE_ID;
|
|
config.headers["platform"] = PLATFORM;
|
|
config.headers["platform"] = PLATFORM;
|