From f8e480d72442e6c1481558a573c5b4f02fb32d4a Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Thu, 10 Oct 2024 09:23:18 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=9C=80=E8=A6=81=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/store/auth.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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; }