From d40f0c3a3b4c16cdd54490af6a0c0bdeeda1599c Mon Sep 17 00:00:00 2001 From: xyq <392009588@qq.com> Date: Fri, 7 Jul 2023 15:22:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=85=E5=9F=BA=E5=9C=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.js | 24 +++++++++++++++++++ .../homeApplication/proposerLite.vue | 22 ++++++++++------- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index dbfdf5d9..2942e8bf 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -210,6 +210,30 @@ const user = { chungengUserLogin(code).then(res => { setToken(res.token) commit('SET_TOKEN', res.token) + getInfo(res.token).then(response => { + const user = response.user; + // const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; + const avatar = ""; + if (response.roles && response.roles.length > 0) { // 验证返回的roles是否是一个非空数组 + commit('SET_ROLES', response.roles) + commit('SET_PERMISSIONS', response.permissions) + } else { + commit('SET_ROLES', ['ROLE_DEFAULT']) + } + commit('SET_BOOKNAME', user.bookName) + commit('SET_NAME', user.userName) + commit('SET_USERID', user.userId) + commit('SET_LOGINDEPTID', user.loginDeptId) + commit('SET_LOGINBOOKID', user.loginBookId) + commit('SET_DEPTNAME', user.deptName) + commit('SET_AVATAR', avatar) + commit('SET_NICKNAME', user.nickName); + commit('SET_businessLevel', user.businessLevel); + //commit('SET_businessLevel', 'TEST'); + getSystemAttachmentUrl().then((resp) => { + commit('SET_baseRoutingUrl', resp.msg); + }); + }) Cookies.set("_Login_url", window.location.href); resolve(res.data) }).catch(error => { diff --git a/src/views/sunVillage_info/homeApplication/proposerLite.vue b/src/views/sunVillage_info/homeApplication/proposerLite.vue index 649c0b84..062c70bd 100644 --- a/src/views/sunVillage_info/homeApplication/proposerLite.vue +++ b/src/views/sunVillage_info/homeApplication/proposerLite.vue @@ -464,7 +464,7 @@