|
@@ -1,8 +1,8 @@
|
|
|
import {UserLoginData} from '@models';
|
|
|
import {QUERY_CLIENT, USER_TOKEN_STORAGE} from '@utils';
|
|
|
-import {startTransition} from 'react';
|
|
|
import {createStore} from 'zustand/vanilla';
|
|
|
import {menuStore} from './menu';
|
|
|
+import {tabStore} from './tab';
|
|
|
|
|
|
type UserStoreState = UserLoginData;
|
|
|
|
|
@@ -41,15 +41,12 @@ export const userStore = createStore<UserStoreState & UserStoreAction>(
|
|
|
// 清除用户缓存
|
|
|
sessionStorage.removeItem(USER_TOKEN_STORAGE);
|
|
|
set(defaultValue());
|
|
|
-
|
|
|
- startTransition(function () {
|
|
|
- // 清除请求缓存
|
|
|
- QUERY_CLIENT.clear();
|
|
|
-
|
|
|
- // 清除菜单缓存
|
|
|
- const {clear} = menuStore.getState();
|
|
|
- clear();
|
|
|
- });
|
|
|
+ // 清除请求缓存
|
|
|
+ QUERY_CLIENT.clear();
|
|
|
+ // 清除菜单缓存
|
|
|
+ menuStore.getState().clear();
|
|
|
+ // 清除tab状态
|
|
|
+ tabStore.getState().clear();
|
|
|
},
|
|
|
setMenu(menus) {
|
|
|
set({menu: menus.join(',') + ','});
|