index.js 979 B

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