From 3e7c2f26fa1bfed32ad8e00919edf3ab71930fe4 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期二, 18 六月 2024 22:54:30 +0800
Subject: [PATCH] update 增加 用户信息缓存增加租户id

---
 src/store/modules/user.ts |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts
index 7c02de0..67fd740 100644
--- a/src/store/modules/user.ts
+++ b/src/store/modules/user.ts
@@ -1,15 +1,16 @@
 import { to } from 'await-to-js';
-import defAva from '@/assets/images/profile.jpg';
-import store from '@/store';
 import { getToken, removeToken, setToken } from '@/utils/auth';
 import { login as loginApi, logout as logoutApi, getInfo as getUserInfo } from '@/api/login';
 import { LoginData } from '@/api/types';
+import defAva from '@/assets/images/profile.jpg';
+import store from '@/store';
 
 export const useUserStore = defineStore('user', () => {
   const token = ref(getToken());
   const name = ref('');
   const nickname = ref('');
   const userId = ref<string | number>('');
+  const tenantId = ref<string>('');
   const avatar = ref('');
   const roles = ref<Array<string>>([]); // 鐢ㄦ埛瑙掕壊缂栫爜闆嗗悎 鈫� 鍒ゆ柇璺敱鏉冮檺
   const permissions = ref<Array<string>>([]); // 鐢ㄦ埛鏉冮檺缂栫爜闆嗗悎 鈫� 鍒ゆ柇鎸夐挳鏉冮檺
@@ -49,6 +50,7 @@
       nickname.value = user.nickName;
       avatar.value = profile;
       userId.value = user.userId;
+      tenantId.value = user.tenantId;
       return Promise.resolve();
     }
     return Promise.reject(err);

--
Gitblit v1.9.3