From 639a4f0b1fa4bf7eceb85352b0f0231283e64d42 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Wed, 19 Jun 2024 12:03:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BF=9D=E5=AD=98userId=E4=BF=A1=E6=81=AF=E5=81=9A=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 1d4d4629..1a9b1932 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -9,6 +9,8 @@ import { parseUrlPath } from '@/plugins/file-static-url'; /**用户信息类型 */ type UserInfo = { + /**用户ID */ + userId: string; /**登录账号 */ userName: string; /**用户角色 字符串数组 */ @@ -31,6 +33,7 @@ type UserInfo = { const useUserStore = defineStore('user', { state: (): UserInfo => ({ + userId: '', userName: '', roles: [], permissions: [], @@ -109,6 +112,7 @@ const useUserStore = defineStore('user', { const res = await getInfo(); if (res.code === RESULT_CODE_SUCCESS && res.data) { const { user, roles, permissions } = res.data; + this.userId = user.userId; // 登录账号 this.userName = user.userName; // 用户头像