main.js 894 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import App from './App'
  2. import uView from "uview-ui";
  3. import verify from './common/graceChecker.js' //数据校验证
  4. import http from './common/http.js'
  5. import util from './common/util.js' //工具类
  6. import common from './common/common.js' //工具类
  7. Vue.use(uView);
  8. // #ifndef VUE3
  9. import Vue from 'vue'
  10. Vue.config.productionTip = false
  11. App.mpType = 'app'
  12. Vue.prototype.verify = verify;
  13. Vue.prototype.http = http;
  14. Vue.prototype.util = util;
  15. Vue.prototype.common = common;
  16. Vue.prototype.getUser = function() {
  17. return uni.getStorageSync('info');
  18. }
  19. Vue.prototype.hasAuth = () => {
  20. let user = uni.getStorageSync('info');
  21. if (user.auth == '0') {
  22. return false
  23. } else {
  24. return true
  25. }
  26. }
  27. const app = new Vue({
  28. ...App
  29. })
  30. app.$mount()
  31. // #endif
  32. // #ifdef VUE3
  33. import {
  34. createSSRApp
  35. } from 'vue'
  36. export function createApp() {
  37. const app = createSSRApp(App)
  38. return {
  39. app
  40. }
  41. }
  42. // #endif