Browse Source

菜单页按钮判断增加

master
aBin 3 years ago
parent
commit
cb4a8edf2c
  1. 6
      src/store/modules/user.js
  2. 9
      src/views/layout/Layout.vue

6
src/store/modules/user.js

@ -13,7 +13,8 @@ const user = {
roles: [],
setting: {
articlePlatform: []
}
},
perList: [],
},
mutations: {
@ -40,6 +41,9 @@ const user = {
},
SET_ROLES: (state, roles) => {
state.roles = roles
},
SET_PER_LIST: (state, perList) => {
state.perList = perList
}
},

9
src/views/layout/Layout.vue

@ -11,7 +11,9 @@
<script>
import { Navbar, Sidebar, AppMain, TagsView } from './components'
import { GET_ALL_HAVE } from '@/api/jurisdiction'
import ResizeMixin from './mixin/ResizeHandler'
import { mapMutations } from 'vuex'
export default {
name: 'Layout',
@ -39,8 +41,15 @@ export default {
}
},
methods: {
...mapMutations('SET_PER_LIST'),
handleClickOutside() {
this.$store.dispatch('closeSideBar', { withoutAnimation: false })
},
getPerList() {
GET_ALL_HAVE({}).then(res => {
console.log(res)
})
}
}
}

Loading…
Cancel
Save