main.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import Vue from 'vue';
  2. import App from './App';
  3. // 弹出框
  4. import pubc from '@/common/public.js'
  5. // 多语言本地化
  6. import VueI18n from 'vue-i18n'
  7. import messages from './locale/index'
  8. import filters from '@/common/filters.js';
  9. let i18nConfig = {
  10. locale: uni.getLocale(),
  11. messages
  12. }
  13. Vue.use(VueI18n)
  14. const i18n = new VueI18n(i18nConfig)
  15. Vue.config.productionTip = false
  16. Vue.prototype.$apiHost = 'https://e.zhichao.art/Gapi';
  17. Vue.prototype.$apiHost2 = 'https://e.zhichao.art/Gapi2';
  18. Vue.prototype.$isWeb3 = 0;
  19. // 分享链接
  20. Vue.prototype.$shareUrl = 'https://e.zhichao.art/share/#/';
  21. // 分享图标 默认为logo
  22. Vue.prototype.$icon = 'https://e.zhichao.art/static/logo.png';
  23. // Vue.prototype.now = Date.now || function () {
  24. // return new Date().getTime();
  25. // };
  26. Vue.prototype.isArray = Array.isArray || function(obj) {
  27. return obj instanceof Array;
  28. };
  29. //挂载全局http请求
  30. import $http from '@/common/requestConfig'
  31. Vue.prototype.$http = $http;
  32. App.mpType = 'app'
  33. // 注册全局过滤器
  34. Object.keys(filters).forEach(key => {
  35. Vue.filter(key, filters[key]);
  36. });
  37. const app = new Vue({
  38. i18n,
  39. ...App
  40. })
  41. app.$mount()