main.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import Vue from 'vue'
  2. import App from './App'
  3. import store from './store'
  4. import Cache from './utils/cache'
  5. import util from 'utils/util'
  6. Vue.prototype.$util = util;
  7. Vue.prototype.$Cache = Cache;
  8. Vue.prototype.$eventHub = new Vue();
  9. Vue.config.productionTip = false
  10. // #ifdef H5
  11. import { parseQuery } from "./utils";
  12. import Auth from './libs/wechat';
  13. import { SPREAD } from './config/cache';
  14. // import wx from '@/node_modules/jweixin-module/lib/index'
  15. Vue.prototype.$wechat = Auth;
  16. let cookieName = "VCONSOLE",
  17. query = parseQuery(),
  18. urlSpread = query["spread"],
  19. vconsole = query[cookieName.toLowerCase()],
  20. md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式
  21. md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式
  22. if (urlSpread !== undefined) {
  23. var spread = Cache.get(SPREAD);
  24. urlSpread = parseInt(urlSpread);
  25. if (!Number.isNaN(urlSpread) && spread !== urlSpread) {
  26. Cache.set("spread", urlSpread || 0);
  27. } else if (spread === 0 || typeof spread !== "number") {
  28. Cache.set("spread", urlSpread || 0);
  29. }
  30. }
  31. // if (vconsole !== undefined) {
  32. // if (vconsole === md5UnCrmeb && Cache.has(cookieName))
  33. // Cache.clear(cookieName);
  34. // } else vconsole = Cache.get(cookieName);
  35. // import VConsole from './components/vconsole.min.js'
  36. // if (vconsole !== undefined && vconsole === md5Crmeb) {
  37. // Cache.set(cookieName, md5Crmeb, 3600);
  38. // let vConsole = new VConsole();
  39. // }
  40. if(!!!Auth.isAndroid() && Auth.isWeixin()){
  41. Auth.wechat()
  42. }
  43. // Auth.isWeixin() && Auth.oAuth();
  44. // #endif
  45. App.mpType = 'app'
  46. const app = new Vue({
  47. ...App,
  48. store,
  49. Cache
  50. })
  51. app.$mount();