2023年10月12日 尝试修复cas自动退出后无法退出的问题

This commit is contained in:
bai 2023-10-12 16:38:04 +08:00
parent 7c3d29107a
commit a3ad006606
1 changed files with 10 additions and 3 deletions

View File

@ -19,10 +19,13 @@ import { useI18n } from '/@/hooks/web/useI18n';
import { joinTimestamp, formatRequestDate } from './helper'; import { joinTimestamp, formatRequestDate } from './helper';
import { useUserStoreWithOut } from '/@/store/modules/user'; 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 globSetting = useGlobSetting();
const urlPrefix = globSetting.urlPrefix; const urlPrefix = globSetting.urlPrefix;
const { createMessage, createErrorModal } = useMessage(); const { createMessage, createErrorModal } = useMessage();
// const userStore = useUserStore();
/** /**
* @description: 便 * @description: 便
@ -200,8 +203,12 @@ export const transform: AxiosTransform = {
if (!error?.response?.status) {//找不到返回值,也找不到状态码,则认为是重定向后跨域了, if (!error?.response?.status) {//找不到返回值,也找不到状态码,则认为是重定向后跨域了,
//window.location.href = error?.config?.url || window.location.href;//跳转不正常。。。 //window.location.href = error?.config?.url || window.location.href;//跳转不正常。。。
//window.location.href = 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 { t } = useI18n();
const errorLogStore = useErrorLogStoreWithOut(); const errorLogStore = useErrorLogStoreWithOut();