main.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 BaseMoney from './components/BaseMoney.vue';
  19. Vue.component('BaseMoney', BaseMoney)
  20. Vue.prototype.$util = util;
  21. Vue.prototype.$config = configs;
  22. Vue.prototype.$Cache = Cache;
  23. Vue.prototype.$store = store;
  24. Vue.prototype.$eventHub = new Vue();
  25. Vue.config.productionTip = false
  26. Vue.prototype.$LoginAuth = apps;
  27. Object.keys(filters).forEach(key => {
  28. Vue.filter(key, filters[key])
  29. })
  30. // #ifdef H5
  31. import {
  32. parseQuery
  33. } from "./utils";
  34. import Auth from './libs/wechat';
  35. Vue.prototype.$wechat = Auth;
  36. let cookieName = "VCONSOLE",
  37. query = parseQuery(),
  38. urlSpread = query["sd"],
  39. vconsole = query[cookieName.toLowerCase()],
  40. md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式
  41. md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式
  42. if (urlSpread) {
  43. urlSpread = parseInt(urlSpread);
  44. Cache.setItem({
  45. name: 'spread',
  46. value: urlSpread,
  47. })
  48. }
  49. if (vconsole !== undefined) {
  50. if (vconsole === md5UnCrmeb && Cache.has(cookieName))
  51. Cache.clear(cookieName);
  52. } else vconsole = Cache.get(cookieName);
  53. import VConsole from './components/vconsole.min.js'
  54. if (vconsole !== undefined && vconsole === md5Crmeb) {
  55. Cache.set(cookieName, md5Crmeb, 3600);
  56. let vConsole = new VConsole();
  57. }
  58. // #endif
  59. App.mpType = 'app'
  60. const app = new Vue({
  61. ...App,
  62. store,
  63. Cache
  64. })
  65. app.$mount();