index.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. import user from './model/user'
  4. import shop from './model/shop'
  5. Vue.use(Vuex)
  6. const store = new Vuex.Store({
  7. state: {
  8. // baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置
  9. // #ifndef H5
  10. baseURL: 'http://www.xjkqs.cn', //请求地址配置
  11. // #endif
  12. // #ifdef H5
  13. baseURL: window.location.protocol + "//" + window.location.host,//请求地址配置
  14. // #endif
  15. urlFile:'/index',//项目部署所在文件夹
  16. hasLogin:false,
  17. // #ifdef H5
  18. loginInterceptor:false,//是否打开强制登录
  19. fx:true,//是否显示分销
  20. // #endif
  21. firstUse:false,//保存是否已经加载过初次加载图片
  22. isShowIllegality:false,//是否显示不过审的内容
  23. // #ifdef APP-PLUS
  24. fx:false,//是否显示分销
  25. // #endif
  26. },
  27. mutations: {
  28. // 保存是否要加载引导图
  29. setFirstUse(state, provider){
  30. state.firstUse = provider;
  31. uni.setStorage({ //缓存用户登陆状态
  32. key: 'guideMap',
  33. data: provider
  34. })
  35. },
  36. // #ifdef APP-PLUS
  37. // 是否需要显示阴阳代码
  38. setFx(state, provider){
  39. state.fx = provider;
  40. }
  41. // #endif
  42. },
  43. modules:{
  44. user,
  45. shop
  46. },
  47. actions: {}
  48. })
  49. export default store