mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-17 09:16:37 +08:00
fix(projects): Fix the issue of abnormal tab caching after logout. fixed #495
This commit is contained in:
parent
ad2f24707a
commit
3eeace94dd
@ -7,12 +7,14 @@ import { useRouterPush } from '@/hooks/common/router';
|
||||
import { fetchGetUserInfo, fetchLogin } from '@/service/api';
|
||||
import { localStg } from '@/utils/storage';
|
||||
import { $t } from '@/locales';
|
||||
import { useTabStore } from '@/store/modules/tab';
|
||||
import { useRouteStore } from '../route';
|
||||
import { clearAuthStorage, getToken } from './shared';
|
||||
|
||||
export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
const route = useRoute();
|
||||
const routeStore = useRouteStore();
|
||||
const tabStore = useTabStore();
|
||||
const { toLogin, redirectFromLogin } = useRouterPush(false);
|
||||
const { loading: loginLoading, startLoading, endLoading } = useLoading();
|
||||
|
||||
@ -47,6 +49,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
await toLogin();
|
||||
}
|
||||
|
||||
tabStore.cacheTabs();
|
||||
routeStore.resetStore();
|
||||
}
|
||||
|
||||
|
@ -290,6 +290,7 @@ export const useTabStore = defineStore(SetupStoreId.Tab, () => {
|
||||
resetTabLabel,
|
||||
isTabRetain,
|
||||
updateTabsByLocale,
|
||||
getTabIdByRoute
|
||||
getTabIdByRoute,
|
||||
cacheTabs
|
||||
};
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user