permissionButton.js 928 B

123456789101112131415161718192021222324252627282930
  1. import {departInterence} from '@/api/api.js';
  2. // 权限配置按钮
  3. const permissionButtons = {
  4. state:()=>({
  5. permissionButtons:[]
  6. }),
  7. mutations:{
  8. SET_PERMISSION_BUTTONS:(state,buttons)=>{
  9. state.permissionButtons = buttons
  10. }
  11. },
  12. actions:{
  13. getPermissionButtons({commit}){
  14. return new Promise((resolve,reject)=>{
  15. /* departInterence.getRoleBtnAuth().then(res=>{
  16. const buttons = res.Data || []
  17. commit('SET_PERMISSION_BUTTONS',buttons)
  18. resolve('获取权限按钮成功')
  19. }) */
  20. const buttons = [
  21. {ButtonCode: "system:menu:add"},
  22. ]
  23. commit('SET_PERMISSION_BUTTONS',buttons)
  24. resolve('获取权限按钮成功')
  25. })
  26. }
  27. },
  28. getters:{}
  29. }
  30. export default permissionButtons;