From b1eb82aff6acc419df0a3c4864a02bd0eedd67d2 Mon Sep 17 00:00:00 2001 From: qinjie Date: Thu, 9 Sep 2021 17:58:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index c20f8fe..c6b0e30 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -10,7 +10,7 @@ const user = { welcome: '', avatar: '', roles: [], - buttons: [], // 按钮权限 + buttons: [], // 按钮权限 info: {} }, @@ -38,7 +38,7 @@ const user = { actions: { // 登录 - Login ({ commit }, userInfo) { + Login({ commit }, userInfo) { return new Promise((resolve, reject) => { login(userInfo).then(response => { storage.set(ACCESS_TOKEN, response.token, 24 * 60 * 60 * 1000) @@ -51,7 +51,7 @@ const user = { }, // 获取用户信息 - GetInfo ({ commit }) { + GetInfo({ commit }) { return new Promise((resolve, reject) => { getLoginUser().then(response => { if (response.code === 200) { @@ -59,7 +59,7 @@ const user = { commit('SET_ROLES', 1) commit('SET_BUTTONS', data.permissions) commit('SET_INFO', data) - commit('SET_NAME', { name: data.userName, welcome: welcome() }) + commit('SET_NAME', { name: data.user.userName, welcome: welcome() }) if (data.avatar != null) { commit('SET_AVATAR', process.env.VUE_APP_API_BASE_URL + '/sysFileInfo/preview?id=' + data.avatar) } @@ -72,9 +72,9 @@ const user = { }) }) }, - + // 登出 - Logout ({ commit, state }) { + Logout({ commit, state }) { return new Promise((resolve) => { logout().then(() => { resolve()