index.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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://hy.liuniu946.com',//请求地址配置
  15. // baseURL:'http://haoyue.frp.liuniu946.com',//请求地址配置
  16. urlFile:'/index',//项目部署所在文件夹
  17. userInfo: {}, //登录信息
  18. loginInterceptor:false,//是否打开强制登录
  19. // #ifdef H5 || MP-WEIXIN
  20. weichatInfo:{},//保存微信注册信息
  21. weichatObj:'',//微信对象
  22. // #endif
  23. latitude: '',
  24. longitude: '',
  25. },
  26. mutations: {
  27. //保存微信信息
  28. setWeiChatInfo(state, provider) {
  29. state.weichatInfo = provider;
  30. },
  31. //保存微信对象
  32. setWeiChatObj(state, provider) {
  33. state.weichatObj = provider;
  34. },
  35. setLat(state, provider) {
  36. state.latitude = provider
  37. },
  38. setLon(state, provider) {
  39. state.longitude = provider
  40. },
  41. },
  42. modules:{
  43. user
  44. },
  45. actions: {}
  46. })
  47. export default store