index.js 991 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. import user from './model/user'
  4. import address from './model/address'
  5. Vue.use(Vuex)
  6. const store = new Vuex.Store({
  7. state: {
  8. // baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置
  9. // #ifdef H5
  10. baseURL:window.location.protocol + "//" + window.location.host,//请求地址配置
  11. // #endif
  12. // #ifndef H5
  13. baseURL:'https://hdxy.zjxiyi888.cn',//请求地址配置
  14. // #endif
  15. urlFile:'/index',//项目部署所在文件夹
  16. userInfo: {}, //登录信息
  17. loginInterceptor:false,//是否打开强制登录
  18. // #ifdef H5 || MP-WEIXIN
  19. weichatInfo:{},//保存微信注册信息
  20. weichatObj:'',//微信对象
  21. // #endif
  22. },
  23. mutations: {
  24. //保存微信信息
  25. setWeiChatInfo(state, provider) {
  26. state.weichatInfo = provider;
  27. },
  28. //保存微信对象
  29. setWeiChatObj(state, provider) {
  30. state.weichatObj = provider;
  31. }
  32. },
  33. modules:{
  34. user,
  35. address
  36. },
  37. actions: {}
  38. })
  39. export default store