From a3ad006606697bb7038c9031c9547567641baaf2 Mon Sep 17 00:00:00 2001 From: bai <1643359946@qq.com> Date: Thu, 12 Oct 2023 16:38:04 +0800 Subject: [PATCH] =?UTF-8?q?2023=E5=B9=B410=E6=9C=8812=E6=97=A5=20=E5=B0=9D?= =?UTF-8?q?=E8=AF=95=E4=BF=AE=E5=A4=8Dcas=E8=87=AA=E5=8A=A8=E9=80=80?= =?UTF-8?q?=E5=87=BA=E5=90=8E=E6=97=A0=E6=B3=95=E9=80=80=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/http/axios/index.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index d8d4a32..40ae657 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -19,10 +19,13 @@ import { useI18n } from '/@/hooks/web/useI18n'; import { joinTimestamp, formatRequestDate } from './helper'; import { useUserStoreWithOut } from '/@/store/modules/user'; -import { useSso } from '/@/hooks/web/useSso'; +//import { useSso } from '/@/hooks/web/useSso'; +// import { useUserStore } from '/@/store/modules/user'; + const globSetting = useGlobSetting(); const urlPrefix = globSetting.urlPrefix; const { createMessage, createErrorModal } = useMessage(); +// const userStore = useUserStore(); /** * @description: 数据处理,方便区分多种处理方式 @@ -200,8 +203,12 @@ export const transform: AxiosTransform = { if (!error?.response?.status) {//找不到返回值,也找不到状态码,则认为是重定向后跨域了, //window.location.href = error?.config?.url || window.location.href;//跳转不正常。。。 //window.location.href = window.location.href; - useSso().ssoLoginOut(); - } + //useSso().ssoLoginOut(); + //userStore.logout(); + const userStore = useUserStoreWithOut(); + userStore.setToken(undefined); + userStore.logout(true); + } const { t } = useI18n(); const errorLogStore = useErrorLogStoreWithOut();