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