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