From cf7e71c6d0fb64eeb6b5deac540da843b4bb465c Mon Sep 17 00:00:00 2001 From: QYF-GitLab1 <1940665526@qq.com> Date: 星期二, 26 八月 2025 10:41:52 +0800 Subject: [PATCH] 关于我们-理念与品牌文化 --- src/plugin/axios/index.ts | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/plugin/axios/index.ts b/src/plugin/axios/index.ts index 365be33..4c20875 100644 --- a/src/plugin/axios/index.ts +++ b/src/plugin/axios/index.ts @@ -2,11 +2,13 @@ import myConfig from '@/assets/js/config.js' import toolClass from '@/assets/js/toolClass.js' import router from '@/router' +import { inject } from 'vue' // 鍒涘缓 axios 瀹炰緥 const service = axios.create({ baseURL: myConfig.requestCtx, timeout: myConfig.requestTimeOut, // 璇锋眰瓒呮椂鏃堕棿 }) +const logIn = inject('logIn') // 璇锋眰鎷︽埅鍣� service.interceptors.request.use( @@ -48,7 +50,6 @@ (error) => { if ((error.response && error.response.status == 401) || error.code == 'ERR_NETWORK') { console.log(router, 'router') - localStorage.removeItem(myConfig.tokenKey) localStorage.removeItem('xiehe-userInfo') localStorage.removeItem('xiehe-isUserInfo') @@ -59,17 +60,16 @@ sessionStorage.removeItem('cartNumber') const url = window.location.hash.slice(1) console.log(url, 'url') - if (url.includes('showLogin=1')) { - router.push(url) - } else { - // router.push(url) - if (url.includes('?')) { - console.log(url.includes('?')) - router.push(url) - } else { - router.push(url + '?showLogin=1') - } - } + window.location.href = `${myConfig.requestCtx}/home/#/home?login=true&callBackUrl=${encodeURIComponent(window.location.href)}` + // window.location.href = `${'http://192.168.3.16:5173'}/#/home?login=true&callBackUrl=${encodeURIComponent(window.location.href)}` + + router.push({ + path: '/home', + query: { + login: 'true', + callBackUrl: encodeURIComponent(window.location.href), + }, + }) } else { if (error.response && error.response.data && error.response.data.error) { console.error(error.response.data.error.msg) -- Gitblit v1.9.1