乡村相册登录选择调用
This commit is contained in:
@@ -11,11 +11,11 @@ let instance = axios.create({
|
|||||||
instance.interceptors.request.use(config => {
|
instance.interceptors.request.use(config => {
|
||||||
store.commit('initWaterMarker')
|
store.commit('initWaterMarker')
|
||||||
console.log(config)
|
console.log(config)
|
||||||
if (/AppCountryAlbum/.test(location.pathname)||config.module=='AppCountryAlbum') {
|
if (/\/node\//.test(config.url)) {
|
||||||
|
config.baseURL = '/ns'
|
||||||
|
} else if (/AppCountryAlbum/.test(location.pathname) || config.module == 'AppCountryAlbum') {
|
||||||
config.baseURL = '/aca'
|
config.baseURL = '/aca'
|
||||||
config.url = config.url.replace(/(app|auth|admin)\//, "api/")
|
config.url = config.url.replace(/(app|auth|admin)\//, "api/")
|
||||||
} else if (/\/node\//.test(config.url)) {
|
|
||||||
config.baseURL = '/ns'
|
|
||||||
} else if (/\/grid\//.test(location.pathname)) {
|
} else if (/\/grid\//.test(location.pathname)) {
|
||||||
config.baseURL = '/wangge'
|
config.baseURL = '/wangge'
|
||||||
} else if (/\/project\/police\//.test(location.pathname)) {
|
} else if (/\/project\/police\//.test(location.pathname)) {
|
||||||
@@ -50,7 +50,7 @@ instance.interceptors.response.use(res => {
|
|||||||
return res.data
|
return res.data
|
||||||
} else if (res.data.code == 401) {
|
} else if (res.data.code == 401) {
|
||||||
store.commit("logout");
|
store.commit("logout");
|
||||||
uni.showToast({title: "请登录用户!"})
|
uni.showToast({title: "请登录用户!", icon: "none"})
|
||||||
} else {
|
} else {
|
||||||
console.error(res.data.msg || "请求失败!")
|
console.error(res.data.msg || "请求失败!")
|
||||||
return Promise.reject(res.data.msg)
|
return Promise.reject(res.data.msg)
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ const store = new Vuex.Store({
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res?.access_token) {
|
if (res?.access_token) {
|
||||||
state.commit("login", [res?.token_type, res?.access_token].join(" ").trim())
|
state.commit("login", [res?.token_type, res?.access_token].join(" ").trim())
|
||||||
state.dispatch("getAccount")
|
module != 'AppCountryAlbum' && state.dispatch("getAccount")
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|||||||
Reference in New Issue
Block a user