调整部分框架
This commit is contained in:
@@ -13,16 +13,15 @@ instance.interceptors.request.use(config => {
|
||||
if (/AppCountryAlbum/.test(location.pathname)) {
|
||||
config.baseURL = '/aca'
|
||||
config.url = config.url.replace(/(app|auth|admin)\//, "api/")
|
||||
}
|
||||
if (/\/grid\//.test(location.pathname)) {
|
||||
} else if (/\/node\//.test(config.url)) {
|
||||
config.baseURL = '/ns'
|
||||
} else if (/\/grid\//.test(location.pathname)) {
|
||||
config.baseURL = '/wangge'
|
||||
}
|
||||
if (/\/project\/police\//.test(location.pathname)) {
|
||||
} else if (/\/project\/police\//.test(location.pathname)) {
|
||||
config.baseURL = '/hnjc'
|
||||
config.url = config.url.replace(/(app|auth|admin)\//, "api/")
|
||||
}
|
||||
if (sessionStorage.getItem("prj") == "saas") {
|
||||
config.url = config.url.replace(/(app|auth|admin)\//, "api/")
|
||||
} else if (sessionStorage.getItem("prj") == "saas") {
|
||||
config.baseURL = '/online'
|
||||
}
|
||||
if (!config.withoutToken && store.state.token) {
|
||||
config.headers["Authorization"] = store.state.token
|
||||
@@ -50,7 +49,7 @@ instance.interceptors.response.use(res => {
|
||||
return res.data
|
||||
} else if (res.data.code == 401) {
|
||||
store.commit("logout");
|
||||
uni.navigateTo({url: "/pages/login"})
|
||||
uni.showToast({title: "请登录用户!"})
|
||||
} else {
|
||||
console.error(res.data.msg || "请求失败!")
|
||||
return Promise.reject(res.data.msg)
|
||||
|
||||
Reference in New Issue
Block a user