main.js 743 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import Vue from 'vue'
  2. import App from './App'
  3. import api from './common/api.js'
  4. import {
  5. gotoPage
  6. } from './common/utils.js'
  7. import langs from './common/lang.js'
  8. Vue.prototype.$request = api
  9. Vue.prototype.gotoPage = gotoPage
  10. let locale = uni.getStorageSync('locale')
  11. locale = typeof(locale) != 'undefined' && locale ? locale : 'zh_cn'
  12. Vue.prototype.langs = langs.langs
  13. Vue.prototype.lang = langs.langs[locale]
  14. Vue.config.productionTip = false
  15. App.mpType = 'app'
  16. // 引入全局uView
  17. import uView from 'uview-ui'
  18. Vue.use(uView);
  19. //封装登录检查
  20. Vue.prototype.checkLogin = function() {
  21. var TOKEN = uni.getStorageSync('tokens');
  22. if (TOKEN == '') {
  23. return false;
  24. }
  25. return true;
  26. }
  27. const app = new Vue({
  28. ...App
  29. })
  30. app.$mount()