index.js 960 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import Vue from 'vue';
  2. import Vuex from 'vuex';
  3. import systemModule from './modules/system';
  4. import usersModule from './modules/users';
  5. Vue.use(Vuex);
  6. export default new Vuex.Store({
  7. state: {
  8. userInfo: {},
  9. menus: [
  10. { id: '01', name: '工作台', url: '/dashboard' },
  11. {
  12. id: '02',
  13. name: '系统管理',
  14. url: '',
  15. icon: '',
  16. children: [
  17. {
  18. id: '0201',
  19. name: '用户管理',
  20. url: '/user',
  21. },
  22. {
  23. id: '0202',
  24. name: '角色管理',
  25. url: '/role',
  26. },
  27. {
  28. id: '0203',
  29. name: '菜单管理',
  30. url: '/menu',
  31. },
  32. ],
  33. },
  34. ],
  35. },
  36. getters: {},
  37. mutations: {
  38. setUserInfo(state, user) {
  39. state.userInfo = user;
  40. },
  41. },
  42. actions: {},
  43. modules: {
  44. system: systemModule,
  45. users: usersModule,
  46. },
  47. plugins: [],
  48. });