diff --git a/.env.development b/.env.development index 7b8a591..a8c1497 100644 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ ENV = 'dev' VITE_APP_API_VERSION ="" VITE_APP_API_BASEURL = https://dev.wms.api.v2.f2b211.com/v1/admapi/ -VITE_APP_SSO_LOGINURL = http://dev.uc.v3.f2b211.com/uc/login # http://dev.uc.f2b211.com/index.php/uc/user/login.html +VITE_APP_SSO_LOGINURL = https://dev.uc.v3.f2b211.com/uc/login # http://dev.uc.f2b211.com/index.php/uc/user/login.html VITE_APP_SSO_APPID = 101341644040699904 VITE_REDIRECT_URL =http://localhost:8080/login #单点从定向地址 diff --git a/.env.production b/.env.production index 3fc5f4e..77769eb 100644 --- a/.env.production +++ b/.env.production @@ -1,10 +1,10 @@ ENV = 'production' VITE_APP_API_VERSION = "" #版本号 VITE_APP_API_BASEURL = https://opsscmapi.f2b211.com/api/ #请求地址 -VITE_APP_SSO_LOGINURL = http://uc.v3.f2b211.com/uc/login +VITE_APP_SSO_LOGINURL = https://uc.v3.f2b211.com/uc/login VITE_APP_SSO_APPID = 100664627590856707 -VITE_REDIRECT_URL = https://opsscm.f2b211.com/login #单点从定向地址 +VITE_REDIRECT_URL = https://wms.v2.f2b211.com/login #单点从定向地址 VITE_SINGLE_URL = https://uc.v3.f2b211.com/ #单点登录通知 # 线上环境 VITE_USER_NODE_ENV = production diff --git a/.env.test b/.env.test index a7a1f50..6860fef 100644 --- a/.env.test +++ b/.env.test @@ -1,7 +1,7 @@ ENV = 'test' VITE_APP_API_VERSION ="" VITE_APP_API_BASEURL = https://dev.wms.api.v2.f2b211.com/v1/admapi/ -VITE_APP_SSO_LOGINURL = http://dev.uc.v3.f2b211.com/uc/login # http://dev.uc.f2b211.com/index.php/uc/user/login.html +VITE_APP_SSO_LOGINURL = https://dev.uc.v3.f2b211.com/uc/login # http://dev.uc.f2b211.com/index.php/uc/user/login.html VITE_APP_SSO_APPID = 101341644040699904 VITE_REDIRECT_URL =https://dev.wms.v2.f2b211.com/login #单点从定向地址 diff --git a/src/api/index.ts b/src/api/index.ts index 2e69910..52d4e8f 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -60,8 +60,17 @@ class RequestHttp { this.service.interceptors.response.use( (response: AxiosResponse) => { const { data } = response; - // const userStore = useUserStore(); + tryHideFullScreenLoading(); + // 获取响应头中的 Authorization 信息 + const authorization = response.headers["authorization"]; + //刷新token + if (authorization) { + // 可以在这里更新用户的 token 信息 + const userStore = useUserStore(); + userStore.setToken(authorization); + return data; + } // 登陆失效 if (data.code == 401) { ElMessage.error(data.msg || data.message); diff --git a/src/components/SearchForm/index.vue b/src/components/SearchForm/index.vue index 6937112..c75db94 100644 --- a/src/components/SearchForm/index.vue +++ b/src/components/SearchForm/index.vue @@ -58,7 +58,7 @@ v-if="item.type === 'selectRemote' || item.type === 'selectRemote1' || item.type === 'selectRemote2'" >