main.js 757 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import Vue from 'vue'
  2. import App from './App'
  3. import http from './common/http.js'
  4. import verify from './common/graceChecker.js' //数据验证
  5. import util from './common/util.js' //工具类
  6. Vue.config.productionTip = false
  7. Vue.prototype.$http = http;
  8. Vue.prototype.$verify = verify;
  9. Vue.prototype.$util = util;
  10. import uView from "uview-ui";
  11. Vue.use(uView);
  12. //基本信息
  13. Vue.prototype.$getInfo = () => {
  14. return {
  15. phone: '0771-5828905',
  16. }
  17. }
  18. App.mpType = 'app'
  19. Vue.prototype.$getUser = function() {
  20. return uni.getStorageSync('user');
  21. }
  22. Vue.prototype.$hasLogin = () => {
  23. if (uni.getStorageSync('user') === '' || uni.getStorageSync('user') === null) {
  24. return false
  25. } else {
  26. return true
  27. }
  28. }
  29. const app = new Vue({
  30. ...App
  31. })
  32. app.$mount()