diff --git a/src/common/axios.js b/src/common/axios.js index 148bd9da..784aa118 100644 --- a/src/common/axios.js +++ b/src/common/axios.js @@ -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) diff --git a/src/store/index.js b/src/store/index.js index 4aea6ee6..fc21d100 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -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 => {