index.js 927 B

1234567891011121314151617181920212223242526272829303132333435
  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. // baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置
  8. baseURL:'http://gp.frp.liuniu946.com',//请求地址配置
  9. urlFile:'/index',//项目部署所在文件夹
  10. loginInterceptor:false,//是否打开强制登录
  11. // #ifdef H5 || MP-WEIXIN
  12. weichatInfo:{},//保存微信注册信息
  13. weichatObj:'',//微信对象
  14. // #endif
  15. },
  16. //保存方法的mutations,只要是修改state的内容,都是通过mutations,如果有异步操作再通过actions
  17. mutations: {
  18. //保存微信信息
  19. //下方state是默认参数
  20. setWeiChatInfo(state, provider) {
  21. state.weichatInfo = provider;
  22. },
  23. //保存微信对象
  24. setWeiChatObj(state, provider) {
  25. state.weichatObj = provider;
  26. }
  27. },
  28. modules:{
  29. user
  30. },
  31. actions: {}
  32. })
  33. export default store