|
@@ -29,6 +29,14 @@ const _axiosWithoutResponseInterceptors = axios.create(config);
|
|
|
let wk_token, wk_key;
|
|
|
let wk_orgId;
|
|
|
|
|
|
+function getRootOrgId() {
|
|
|
+ if (location.hostname.includes("qmth.com.cn")) {
|
|
|
+ return "";
|
|
|
+ } else {
|
|
|
+ return "?orgId=" + (wk_orgId === undefined ? "" : wk_orgId);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
_axios.interceptors.request.use(
|
|
|
function(config) {
|
|
|
// Do something before request is sent
|
|
@@ -47,7 +55,7 @@ _axios.interceptors.request.use(
|
|
|
// } else {
|
|
|
// router.push("/login");
|
|
|
// }
|
|
|
- router.push("/login/" + "?orgId=" + wk_orgId);
|
|
|
+ router.push("/login/" + getRootOrgId());
|
|
|
}
|
|
|
});
|
|
|
return;
|
|
@@ -86,7 +94,7 @@ _axiosWithoutResponseInterceptors.interceptors.request.use(
|
|
|
Vue.prototype.$alert("登录失效,请重新登录!", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
callback: () => {
|
|
|
- router.push("/login/" + "?orgId=" + wk_orgId);
|
|
|
+ router.push("/login/" + getRootOrgId());
|
|
|
}
|
|
|
});
|
|
|
return;
|
|
@@ -140,7 +148,7 @@ _axios.interceptors.response.use(
|
|
|
Vue.prototype.$alert("登录失效,请重新登录!", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
callback: () => {
|
|
|
- router.push("/login/" + "?orgId=" + wk_orgId);
|
|
|
+ router.push("/login/" + getRootOrgId());
|
|
|
}
|
|
|
});
|
|
|
return Promise.reject(error);
|
|
@@ -148,7 +156,7 @@ _axios.interceptors.response.use(
|
|
|
Vue.prototype.$alert("没有权限!", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
callback: () => {
|
|
|
- router.push("/login/" + "?orgId=" + wk_orgId);
|
|
|
+ router.push("/login/" + getRootOrgId());
|
|
|
}
|
|
|
});
|
|
|
return Promise.reject(error);
|
|
@@ -212,7 +220,7 @@ _axiosWithoutResponseInterceptors.interceptors.response.use(
|
|
|
Vue.prototype.$alert("登录失效,请重新登录!", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
callback: () => {
|
|
|
- router.push("/login/" + "?orgId=" + wk_orgId);
|
|
|
+ router.push("/login/" + getRootOrgId());
|
|
|
}
|
|
|
});
|
|
|
return Promise.reject(error);
|
|
@@ -220,7 +228,7 @@ _axiosWithoutResponseInterceptors.interceptors.response.use(
|
|
|
Vue.prototype.$alert("没有权限!", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
callback: () => {
|
|
|
- router.push("/login/" + "?orgId=" + wk_orgId);
|
|
|
+ router.push("/login/" + getRootOrgId());
|
|
|
}
|
|
|
});
|
|
|
return Promise.reject(error);
|