main.js 712 B

12345678910111213141516171819202122232425262728293031323334
  1. import App from './App'
  2. import http from './common/http.js'
  3. import verify from './common/graceChecker.js' //数据验证
  4. import util from './common/util.js' //工具类
  5. import Vue from 'vue'
  6. Vue.config.productionTip = false
  7. Vue.prototype.http = http;
  8. Vue.prototype.verify = verify;
  9. Vue.prototype.util = util;
  10. import uView from '@/uni_modules/uview-ui'
  11. Vue.use(uView)
  12. App.mpType = 'app'
  13. Vue.prototype.getUser = function() {
  14. return uni.getStorageSync('user');
  15. }
  16. Vue.prototype.hasPermi = util.hasPermi;
  17. Vue.prototype.hasLogin = () => {
  18. if (uni.getStorageSync('user') === '' || uni.getStorageSync('user') === null) {
  19. return false
  20. } else {
  21. return true
  22. }
  23. }
  24. const app = new Vue({
  25. ...App
  26. })
  27. app.$mount()