index.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import {
  2. createSSRApp
  3. } from 'vue'
  4. import Vuex from 'vuex'
  5. import user from './model/user'
  6. import shop from './model/shop'
  7. export function createApp() {
  8. const app = createSSRApp(App)
  9. app.use(Vuex)
  10. return {
  11. app
  12. }
  13. }
  14. const store = new Vuex.Store({
  15. state: {
  16. // baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置
  17. baseURL: 'http://grade.liuniukj.com', //请求地址配置
  18. // baseURL:'http://dp.frp.shuibo.net',//请求地址配置
  19. urlFile: '/index', //项目部署所在文件夹
  20. hasLogin: false,
  21. // #ifdef H5
  22. loginInterceptor: false, //是否打开强制登录
  23. fx: true, //是否显示分销
  24. // #endif
  25. firstUse: false, //保存是否已经加载过初次加载图片
  26. isShowIllegality: false, //是否显示不过审的内容
  27. // #ifdef APP-PLUS
  28. fx: false, //是否显示分销
  29. // #endif
  30. },
  31. mutations: {
  32. // 保存是否要加载引导图
  33. setFirstUse(state, provider) {
  34. state.firstUse = provider;
  35. uni.setStorage({ //缓存用户登陆状态
  36. key: 'guideMap',
  37. data: provider
  38. })
  39. },
  40. // #ifdef APP-PLUS
  41. // 是否需要显示阴阳代码
  42. setFx(state, provider) {
  43. state.fx = provider;
  44. }
  45. // #endif
  46. },
  47. modules: {
  48. user,
  49. shop
  50. },
  51. actions: {}
  52. })
  53. export default store