index.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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: 'https://red.liuniu946.com', //请求地址配置
  9. // #endif
  10. // #ifndef MP
  11. baseURL: 'https://red.liuniu946.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. project_area: 0
  26. },
  27. mutations: {
  28. // #ifdef H5
  29. tabbar(state,provider){
  30. state.tabbarindex = provider;
  31. },
  32. //保存微信信息
  33. setWeiChatInfo(state, provider) {
  34. state.weichatInfo = provider;
  35. },
  36. setSpread(state, provider) {
  37. state.Spread = provider;
  38. },
  39. //保存微信对象
  40. setWeiChatObj(state, provider) {
  41. state.weichatObj = provider;
  42. }
  43. // #endif
  44. },
  45. modules:{
  46. user
  47. },
  48. actions: {
  49. }
  50. })
  51. export default store