index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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://m.manyuanchunjia.com", //请求地址配置
  8. // baseURL:"http://myc.frp.liuniu946.com",//请求地址配置
  9. loginInterceptor: true, //是否打开强制登录
  10. urlFile: '/index', //项目部署所在文件夹
  11. // #ifdef H5 || MP-WEIXIN
  12. weichatInfo: {}, //保存微信注册信息
  13. weichatObj: '', //微信对象
  14. // #endif
  15. // #ifdef APP-PLUS
  16. isShowIllegality: false, //不显示ios审核不允许的功能
  17. // #endif
  18. // #ifndef APP-PLUS
  19. isShowIllegality: true, //允许显示隐藏信息
  20. // #endif
  21. latitude: '',
  22. longitude: '',
  23. storeInfo: {},
  24. canChange: 1,
  25. },
  26. mutations: {
  27. //保存微信信息
  28. setWeiChatInfo(state, provider) {
  29. state.weichatInfo = provider;
  30. },
  31. //保存微信对象
  32. setWeiChatObj(state, provider) {
  33. state.weichatObj = provider;
  34. },
  35. // 修改显示隐藏ios审核不允许显示的功能
  36. changeState(state, provider) {
  37. state.isShowIllegality = provider;
  38. },
  39. setLat(state, provider) {
  40. state.latitude = provider
  41. },
  42. setLon(state, provider) {
  43. state.longitude = provider
  44. },
  45. setStoreInfo(state, provider) {
  46. state.storeInfo = provider
  47. console.log(state.storeInfo, 'success');
  48. },
  49. setCanChange(state) {
  50. state.canChange = 0
  51. console.log('不能点击')
  52. }
  53. },
  54. modules: {
  55. user
  56. },
  57. actions: {}
  58. })
  59. export default store