main.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // +---------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +---------------------------------------------------------------------
  4. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  5. // +---------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +---------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +---------------------------------------------------------------------
  10. import Vue from 'vue'
  11. import App from './App'
  12. import store from './store'
  13. import Cache from './utils/cache'
  14. import util from 'utils/util'
  15. import configs from './config/app.js'
  16. import apps from './libs/apps.js' //校验登录是否失效
  17. import * as filters from '@/filters'
  18. import locationManager from './utils/locationManager.js' // 导入定位管理器
  19. import BaseMoney from './components/BaseMoney.vue';
  20. Vue.component('BaseMoney', BaseMoney)
  21. Vue.prototype.$util = util;
  22. Vue.prototype.$config = configs;
  23. Vue.prototype.$Cache = Cache;
  24. Vue.prototype.$store = store;
  25. Vue.prototype.$eventHub = new Vue();
  26. Vue.prototype.$locationManager = locationManager; // 添加定位管理器到全局
  27. Vue.config.productionTip = false
  28. Vue.prototype.$LoginAuth = apps;
  29. Vue.prototype.$getCssVarStyle = function () {
  30. return this.$root.$cssVars || uni.getStorageSync('__CSS_VARS__') || {};
  31. };
  32. // 初始化定位管理器
  33. locationManager.init();
  34. Object.keys(filters).forEach(key => {
  35. Vue.filter(key, filters[key])
  36. })
  37. // #ifdef H5
  38. import {
  39. parseQuery
  40. } from "./utils";
  41. import Auth from './libs/wechat';
  42. Vue.prototype.$wechat = Auth;
  43. let cookieName = "VCONSOLE",
  44. query = parseQuery(),
  45. urlSpread = query["sd"],
  46. vconsole = query[cookieName.toLowerCase()],
  47. md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式
  48. md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式
  49. if (urlSpread) {
  50. urlSpread = parseInt(urlSpread);
  51. Cache.setItem({
  52. name: 'spread',
  53. value: urlSpread,
  54. })
  55. }
  56. if (vconsole !== undefined) {
  57. if (vconsole === md5UnCrmeb && Cache.has(cookieName))
  58. Cache.clear(cookieName);
  59. } else vconsole = Cache.get(cookieName);
  60. import VConsole from './components/vconsole.min.js'
  61. if (vconsole !== undefined && vconsole === md5Crmeb) {
  62. Cache.set(cookieName, md5Crmeb, 3600);
  63. let vConsole = new VConsole();
  64. }
  65. // #endif
  66. App.mpType = 'app'
  67. const app = new Vue({
  68. ...App,
  69. store,
  70. Cache
  71. })
  72. app.$mount();