Prechádzať zdrojové kódy

fixup! fix: 😀修复租户id为空时无法跳转的问题

喵你个旺呀 1 rok pred
rodič
commit
221973b638

+ 2 - 0
Web/src/stores/userInfo.ts

@@ -83,6 +83,8 @@ export const useUserInfo = defineStore('userInfo', {
 							tenantId: d.tenantId,
 							time: new Date().getTime(),
 						};
+						Local.set('t', userInfos.tenantId);
+
 						// vue-next-admin 提交Id:225bce7 提交消息:admin-23.03.26:发布v2.4.32版本
 						// 增加了下面代码,引起当前会话的用户信息不会刷新,如:重新提交的头像不更新,需要新开一个页面才能正确显示
 						// Session.set('userInfo', userInfos);

+ 4 - 1
Web/src/utils/axios-utils.ts

@@ -38,7 +38,10 @@ export const clearAccessAfterReload = () => {
 	const tenantId = useUserInfo().userInfos.tenantId;
 
 	clearTokens();
-	if (tenantId) Local.set('t', tenantId);
+	if (tenantId) {
+		Local.remove('t');
+		Local.set('t', tenantId);
+	}
 
 	// 刷新浏览器
 	window.location.reload();