index.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. Vue.use(Vuex)
  4. const store = new Vuex.Store({
  5. /* 状态对象 */
  6. state:{
  7. isLogin:false,
  8. user:{}, //用户信息
  9. token:{}, //令牌
  10. name:"", //姓名
  11. avatar:"", //头像
  12. roles:[], //角色
  13. introduction:"" , //用户信息
  14. departmentName:"", //部门名称
  15. departmentCode:"", //部门编码
  16. stationCode:"", //岗位编码
  17. stationName:"" , //岗位名称
  18. projectCode:"" //项目代码
  19. },
  20. mutations: {
  21. setIsLogin(state,isLogin){
  22. state.isLogin=isLogin;
  23. },
  24. setUser(state,user){
  25. state.user=user;
  26. },
  27. setToken(state,token){
  28. state.token=token;
  29. },
  30. setName(state,name){
  31. state.name=name;
  32. },
  33. setAvatar(state,avatar){
  34. state.avatar=avatar;
  35. },
  36. setRoles(state,roles){
  37. state.roles=roles;
  38. },
  39. setIntroduction(state,introduction){
  40. state.introduction=introduction;
  41. },
  42. setDepartmentCode(state,departmentCode){
  43. state.departmentCode=departmentCode;
  44. },
  45. setDepartmentName(state,departmentName){
  46. state.departmentName=departmentName;
  47. },
  48. setStationCode(state,stationCode){
  49. state.stationCode=stationCode;
  50. },
  51. setStationName(state,stationName){
  52. state.stationName=stationName;
  53. },
  54. setProjectCode(state,projectCode){
  55. state.projectCode=projectCode;
  56. }
  57. },
  58. getters:{
  59. },
  60. actions: {
  61. // lazy loading openid
  62. }
  63. })
  64. export default store