From d9b743f4df7b4cf5d89785a0fbd518dbe7e0da7a Mon Sep 17 00:00:00 2001 From: "aoli.qu" <408346101@qq.com> Date: Mon, 6 Sep 2021 12:39:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=9D=83=E9=99=90=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/BasicLayout.vue | 6 ++++++ src/store/getters.js | 2 +- src/utils/permissions.js | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/layouts/BasicLayout.vue b/src/layouts/BasicLayout.vue index 67679aa..5ea4987 100644 --- a/src/layouts/BasicLayout.vue +++ b/src/layouts/BasicLayout.vue @@ -120,4 +120,10 @@ export default { diff --git a/src/store/getters.js b/src/store/getters.js index b83c4f4..a65fb87 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -5,7 +5,7 @@ const getters = { color: state => state.app.color, token: state => state.user.token, avatar: state => state.user.avatar, - nickname: state => state.user.name, + name: state => state.user.name, welcome: state => state.user.welcome, roles: state => state.user.roles, buttons: state => state.user.buttons, diff --git a/src/utils/permissions.js b/src/utils/permissions.js index 768f921..83b0bb1 100644 --- a/src/utils/permissions.js +++ b/src/utils/permissions.js @@ -14,8 +14,8 @@ export function actionToObject (json) { */ export function hasBtnPermission (permission) { const myBtns = store.getters.buttons - const nickname = store.getters.nickname - if (nickname == '超级管理员') { + const name = store.getters.name + if (name == 'admin') { return true } return myBtns.indexOf(permission) > -1