From 618846c73a60535411c07b2815a82bddf3356a89 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 19 Feb 2020 13:19:12 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E9=9B=86=E5=90=88=E5=B1=95=E7=A4=BA=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/login/Login.vue | 6 ++++-- frontend/src/performance/App.vue | 6 ++---- .../src/performance/components/settings/SettingMenu.vue | 6 +++--- frontend/src/performance/permission.js | 7 +++++-- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/frontend/src/login/Login.vue b/frontend/src/login/Login.vue index a0ddc5ac2b..fd8dccca81 100644 --- a/frontend/src/login/Login.vue +++ b/frontend/src/login/Login.vue @@ -109,8 +109,10 @@ this.$post("signin", this.form, (response) => { // 登录信息保存 cookie Cookies.set(TokenKey, response.data); - // 保存上次角色 - localStorage.setItem("lastSourceId", JSON.parse(Cookies.get(TokenKey)).lastSourceId); + let rolesArray = response.data.roles; + let roles = rolesArray.map(r => r.id); + // 保存角色 + localStorage.setItem("roles", roles); window.location.href = "/" }); } else { diff --git a/frontend/src/performance/App.vue b/frontend/src/performance/App.vue index de6a245a25..45dadf7905 100644 --- a/frontend/src/performance/App.vue +++ b/frontend/src/performance/App.vue @@ -2,7 +2,6 @@