main.js 843 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. Vue.use(uView);
  7. // #ifndef VUE3
  8. import Vue from 'vue'
  9. Vue.config.productionTip = false
  10. App.mpType = 'app'
  11. Vue.prototype.verify = verify;
  12. Vue.prototype.http = http;
  13. Vue.prototype.util = util;
  14. Vue.prototype.getUser = function() {
  15. return uni.getStorageSync('info');
  16. }
  17. Vue.prototype.hasAuth = () => {
  18. let user = uni.getStorageSync('info');
  19. console.log("asd:"+user.auth);
  20. if (user.auth == '0') {
  21. return false
  22. } else {
  23. return true
  24. }
  25. }
  26. const app = new Vue({
  27. ...App
  28. })
  29. app.$mount()
  30. // #endif
  31. // #ifdef VUE3
  32. import {
  33. createSSRApp
  34. } from 'vue'
  35. export function createApp() {
  36. const app = createSSRApp(App)
  37. return {
  38. app
  39. }
  40. }
  41. // #endif