按钮权限修改
This commit is contained in:
parent
2e71de1cec
commit
d9b743f4df
|
@ -120,4 +120,10 @@ export default {
|
|||
|
||||
<style lang="less">
|
||||
@import "./BasicLayout.less";
|
||||
|
||||
/*隐藏原本的图标*/
|
||||
.ant-pro-global-header-trigger{
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue