main.js 795 B

12345678910111213141516171819202122232425262728293031323334353637
  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.getLocation = function() {
  17. return uni.getStorageSync('location');
  18. }
  19. Vue.prototype.hasPermi = util.hasPermi;
  20. Vue.prototype.hasLogin = () => {
  21. if (uni.getStorageSync('user') === '' || uni.getStorageSync('user') === null) {
  22. return false
  23. } else {
  24. return true
  25. }
  26. }
  27. const app = new Vue({
  28. ...App
  29. })
  30. app.$mount()