update 增加 用户信息缓存增加租户id
This commit is contained in:
		| @ -26,6 +26,7 @@ export interface UserQuery extends PageQuery { | |||||||
|  */ |  */ | ||||||
| export interface UserVO extends BaseEntity { | export interface UserVO extends BaseEntity { | ||||||
|   userId: string | number; |   userId: string | number; | ||||||
|  |   tenantId: string; | ||||||
|   deptId: number; |   deptId: number; | ||||||
|   userName: string; |   userName: string; | ||||||
|   nickName: string; |   nickName: string; | ||||||
|  | |||||||
| @ -10,6 +10,7 @@ export const useUserStore = defineStore('user', () => { | |||||||
|   const name = ref(''); |   const name = ref(''); | ||||||
|   const nickname = ref(''); |   const nickname = ref(''); | ||||||
|   const userId = ref<string | number>(''); |   const userId = ref<string | number>(''); | ||||||
|  |   const tenantId = ref<string>(''); | ||||||
|   const avatar = ref(''); |   const avatar = ref(''); | ||||||
|   const roles = ref<Array<string>>([]); // 用户角色编码集合 → 判断路由权限 |   const roles = ref<Array<string>>([]); // 用户角色编码集合 → 判断路由权限 | ||||||
|   const permissions = ref<Array<string>>([]); // 用户权限编码集合 → 判断按钮权限 |   const permissions = ref<Array<string>>([]); // 用户权限编码集合 → 判断按钮权限 | ||||||
| @ -49,6 +50,7 @@ export const useUserStore = defineStore('user', () => { | |||||||
|       nickname.value = user.nickName; |       nickname.value = user.nickName; | ||||||
|       avatar.value = profile; |       avatar.value = profile; | ||||||
|       userId.value = user.userId; |       userId.value = user.userId; | ||||||
|  |       tenantId.value = user.tenantId; | ||||||
|       return Promise.resolve(); |       return Promise.resolve(); | ||||||
|     } |     } | ||||||
|     return Promise.reject(err); |     return Promise.reject(err); | ||||||
|  | |||||||
| @ -58,6 +58,7 @@ | |||||||
| <script lang="ts" setup> | <script lang="ts" setup> | ||||||
| import { authUnlock, authBinding } from '@/api/system/social/auth'; | import { authUnlock, authBinding } from '@/api/system/social/auth'; | ||||||
| import { propTypes } from '@/utils/propTypes'; | import { propTypes } from '@/utils/propTypes'; | ||||||
|  | import useUserStore from "@/store/modules/user"; | ||||||
|  |  | ||||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||||
|  |  | ||||||
| @ -85,7 +86,7 @@ const unlockAuth = (row: any) => { | |||||||
| const authUrl = (source: string) => { | const authUrl = (source: string) => { | ||||||
|   authBinding(source).then((res: any) => { |   authBinding(source).then((res: any) => { | ||||||
|     if (res.code === 200) { |     if (res.code === 200) { | ||||||
|       window.location.href = res.data; |       window.location.href = res.data + '&tenantId=' + useUserStore().tenantId; | ||||||
|     } else { |     } else { | ||||||
|       proxy?.$modal.msgError(res.msg); |       proxy?.$modal.msgError(res.msg); | ||||||
|     } |     } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 疯狂的狮子Li
					疯狂的狮子Li