main.js 979 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. // Vue.prototype.now = Date.now || function () {
  20. // return new Date().getTime();
  21. // };
  22. Vue.prototype.isArray = Array.isArray || function(obj) {
  23. return obj instanceof Array;
  24. };
  25. //挂载全局http请求
  26. import $http from '@/common/requestConfig'
  27. Vue.prototype.$http = $http;
  28. App.mpType = 'app'
  29. // 注册全局过滤器
  30. Object.keys(filters).forEach(key => {
  31. Vue.filter(key, filters[key]);
  32. });
  33. const app = new Vue({
  34. i18n,
  35. ...App
  36. })
  37. app.$mount()