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/api/system/user/types.ts                 |    1 +
 src/store/modules/user.ts                    |    2 ++
 src/views/system/user/profile/thirdParty.vue |    3 ++-
 3 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/api/system/user/types.ts b/src/api/system/user/types.ts
index 3488e9f..0787372 100644
--- a/src/api/system/user/types.ts
+++ b/src/api/system/user/types.ts
@@ -26,6 +26,7 @@
  */
 export interface UserVO extends BaseEntity {
   userId: string | number;
+  tenantId: string;
   deptId: number;
   userName: string;
   nickName: string;
diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts
index 4122294..67fd740 100644
--- a/src/store/modules/user.ts
+++ b/src/store/modules/user.ts
@@ -10,6 +10,7 @@
   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);
diff --git a/src/views/system/user/profile/thirdParty.vue b/src/views/system/user/profile/thirdParty.vue
index 40daa86..3d489b4 100644
--- a/src/views/system/user/profile/thirdParty.vue
+++ b/src/views/system/user/profile/thirdParty.vue
@@ -58,6 +58,7 @@
 <script lang="ts" setup>
 import { authUnlock, authBinding } from '@/api/system/social/auth';
 import { propTypes } from '@/utils/propTypes';
+import useUserStore from "@/store/modules/user";
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 
@@ -85,7 +86,7 @@
 const authUrl = (source: string) => {
   authBinding(source).then((res: any) => {
     if (res.code === 200) {
-      window.location.href = res.data;
+      window.location.href = res.data + '&tenantId=' + useUserStore().tenantId;
     } else {
       proxy?.$modal.msgError(res.msg);
     }

--
Gitblit v1.9.3