index.js 814 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. lang:'zh_cn',
  8. baseURL:'http://star.frp.liuniu946.com',//请求地址配置
  9. urlFile:'/index',//项目部署所在文件夹
  10. userInfo: {}, //登录信息
  11. loginInterceptor:false,//是否打开强制登录
  12. // #ifdef H5 || MP-WEIXIN
  13. weichatInfo:{},//保存微信注册信息
  14. weichatObj:'',//微信对象
  15. // #endif
  16. },
  17. mutations: {
  18. //切换语言
  19. changelang(state,lang){
  20. state.lang = lang
  21. },
  22. //保存微信信息
  23. setWeiChatInfo(state, provider) {
  24. state.weichatInfo = provider;
  25. },
  26. //保存微信对象
  27. setWeiChatObj(state, provider) {
  28. state.weichatObj = provider;
  29. }
  30. },
  31. modules:{
  32. user
  33. },
  34. actions: {}
  35. })
  36. export default store