You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.6 KiB

3 months ago
  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 global from './libs/global.js'
  17. import apps from './libs/apps.js' //校验登录是否失效
  18. import * as Order from './libs/order';
  19. import skeleton from './components/skeleton/index.vue'
  20. import * as filters from '@/filters'
  21. Vue.component('skeleton', skeleton)
  22. Vue.prototype.$util = util;
  23. Vue.prototype.$config = configs;
  24. Vue.prototype.$Cache = Cache;
  25. Vue.prototype.$eventHub = new Vue();
  26. Vue.config.productionTip = false
  27. Vue.prototype.$Order = Order;
  28. Vue.prototype.$LoginAuth = apps;
  29. Object.keys(filters).forEach(key => {
  30. Vue.filter(key, filters[key])
  31. })
  32. // #ifdef H5
  33. import {
  34. parseQuery
  35. } from "./utils";
  36. import Auth from './libs/wechat';
  37. import {
  38. SPREAD
  39. } from './config/cache';
  40. Vue.prototype.$wechat = Auth;
  41. let cookieName = "VCONSOLE",
  42. query = parseQuery(),
  43. urlSpread = query["spread"],
  44. vconsole = query[cookieName.toLowerCase()],
  45. md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式
  46. md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式
  47. if (urlSpread) {
  48. urlSpread = parseInt(urlSpread);
  49. Cache.setItem({
  50. name: 'spread',
  51. value: urlSpread,
  52. })
  53. // var spread = Cache.get(SPREAD);
  54. // urlSpread = parseInt(urlSpread);
  55. // if (!Number.isNaN(urlSpread) && spread !== urlSpread) {
  56. // Cache.set("spread", urlSpread || 0);
  57. // } else if (spread === 0 || typeof spread !== "number") {
  58. // Cache.set("spread", urlSpread || 0);
  59. // }
  60. }
  61. if (vconsole !== undefined) {
  62. if (vconsole === md5UnCrmeb && Cache.has(cookieName))
  63. Cache.clear(cookieName);
  64. } else vconsole = Cache.get(cookieName);
  65. import VConsole from './components/vconsole.min.js'
  66. if (vconsole !== undefined && vconsole === md5Crmeb) {
  67. Cache.set(cookieName, md5Crmeb, 3600);
  68. let vConsole = new VConsole();
  69. }
  70. // #endif
  71. App.mpType = 'app'
  72. const app = new Vue({
  73. ...App,
  74. store,
  75. Cache
  76. })
  77. app.$mount();