From af03fefc83a9e999e8dbea369d17dd8a71a1a3f3 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 27 Sep 2023 15:27:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=95=B0=E6=8D=AE=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E7=94=A8=E6=88=B7=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/store/modules/user.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ruoyi-ui/src/store/modules/user.js b/ruoyi-ui/src/store/modules/user.js index 262de9b05..7c9b0c700 100644 --- a/ruoyi-ui/src/store/modules/user.js +++ b/ruoyi-ui/src/store/modules/user.js @@ -4,6 +4,7 @@ import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth' const user = { state: { token: getToken(), + id: '', name: '', avatar: '', roles: [], @@ -17,6 +18,9 @@ const user = { SET_EXPIRES_IN: (state, time) => { state.expires_in = time }, + SET_ID: (state, id) => { + state.id = id + }, SET_NAME: (state, name) => { state.name = name }, @@ -64,6 +68,7 @@ const user = { } else { commit('SET_ROLES', ['ROLE_DEFAULT']) } + commit('SET_ID', user.userId) commit('SET_NAME', user.userName) commit('SET_AVATAR', avatar) resolve(res)