diff --git a/apps/web-antd/src/store/auth.ts b/apps/web-antd/src/store/auth.ts index f6dc0a08..7f678e51 100644 --- a/apps/web-antd/src/store/auth.ts +++ b/apps/web-antd/src/store/auth.ts @@ -13,6 +13,8 @@ import { defineStore } from 'pinia'; import { doLogout, getUserInfoApi, loginApi, seeConnectionClose } from '#/api'; import { $t } from '#/locales'; +import { useDictStore } from './dict'; + export const useAuthStore = defineStore('auth', () => { const accessStore = useAccessStore(); const userStore = useUserStore(); @@ -115,6 +117,12 @@ export const useAuthStore = defineStore('auth', () => { username: user.userName, }; userStore.setUserInfo(userInfo); + /** + * 需要重新加载字典 + * 比如退出登录切换到其他租户 + */ + const dictStore = useDictStore(); + dictStore.resetCache(); return userInfo; }