main.js 892 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import App from './App'
  2. import api from '@/apis/api.js'
  3. import common from '@/common/js/common.js'
  4. import uView from "uview-ui";
  5. import verify from './common/graceChecker.js' //数据校验证
  6. import http from './common/http.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.$api = api
  13. Vue.prototype.$common = common
  14. Vue.prototype.verify = verify;
  15. Vue.prototype.http = http;
  16. Vue.prototype.getUser = function() {
  17. return uni.getStorageSync('info');
  18. }
  19. Vue.prototype.hasLogin = () => {
  20. if (uni.getStorageSync('info') === '' || uni.getStorageSync('info') === null) {
  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 { createSSRApp } from 'vue'
  33. export function createApp() {
  34. const app = createSSRApp(App)
  35. return {
  36. app
  37. }
  38. }
  39. // #endif