main.js 835 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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.hasLogin = () => {
  18. if (uni.getStorageSync('info') === '' || uni.getStorageSync('info') === null) {
  19. return false
  20. } else {
  21. return true
  22. }
  23. }
  24. const app = new Vue({
  25. ...App
  26. })
  27. app.$mount()
  28. // #endif
  29. // #ifdef VUE3
  30. import { createSSRApp } from 'vue'
  31. export function createApp() {
  32. const app = createSSRApp(App)
  33. return {
  34. app
  35. }
  36. }
  37. // #endif