index.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. import user from './model/user'
  4. Vue.use(Vuex)
  5. const store = new Vuex.Store({
  6. state: {
  7. // #ifdef MP
  8. baseURL: 'http://hhred.igxys.com', //请求地址配置
  9. // #endif
  10. // #ifndef MP
  11. baseURL: 'http://hhred.igxys.com', //请求地址配置
  12. // #endif
  13. // baseURL: 'http://yrh.liuniu946.com', //请求地址配置
  14. urlFile: '/index', //项目部署所在文件夹
  15. loginInterceptor: false, //是否打开强制登录
  16. token:'',
  17. // #ifdef H5
  18. setWeiChatInfo:'',
  19. Spread:'',
  20. weichatInfo: {}, //保存微信注册信息
  21. weichatObj: '', //微信对象
  22. weichatBrowser: '' ,//当前是否为微信内置浏览器
  23. // #endif
  24. // shareData:'',//分享信息
  25. },
  26. mutations: {
  27. // #ifdef H5
  28. tabbar(state,provider){
  29. state.tabbarindex = provider;
  30. },
  31. //保存微信信息
  32. setWeiChatInfo(state, provider) {
  33. state.weichatInfo = provider;
  34. },
  35. setSpread(state, provider) {
  36. state.Spread = provider;
  37. },
  38. //保存微信对象
  39. setWeiChatObj(state, provider) {
  40. state.weichatObj = provider;
  41. }
  42. // #endif
  43. },
  44. modules:{
  45. user
  46. },
  47. actions: {
  48. }
  49. })
  50. export default store