From c59064402282ccc3a574972ae1e964eed9f26744 Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 31 May 2022 10:31:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=A1=E6=9D=91=E7=9B=B8=E5=86=8C=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=80=89=E6=8B=A9=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/axios.js | 8 ++++---- src/store/index.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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 => {