index.js 991 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. import user from './model/user'
  4. //引入axios模块(先下载`axios`--)
  5. // import axios from 'axios'
  6. import axios from 'axios'
  7. //将axios挂载在vue原型链上
  8. // Vue.prototype.$axios = axios;
  9. Vue.prototype.$axios =axios
  10. Vue.use(Vuex)
  11. const store = new Vuex.Store({
  12. state: {
  13. // baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置
  14. baseURL:'https://xl.liuniu946.com',//请求地址配置
  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. },
  36. actions: {}
  37. })
  38. export default store