main.js 868 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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.prototype.locale = locale
  15. Vue.config.productionTip = false
  16. App.mpType = 'app'
  17. // 引入全局uView
  18. import uView from 'uview-ui'
  19. Vue.use(uView);
  20. //封装登录检查
  21. Vue.prototype.checkLogin = function() {
  22. var TOKEN = uni.getStorageSync('tokens');
  23. if (TOKEN == '') {
  24. return false;
  25. }
  26. return true;
  27. }
  28. import VueClipboard from 'vue-clipboard2' //引入插件
  29. Vue.use(VueClipboard) //安装插件
  30. const app = new Vue({
  31. ...App
  32. })
  33. app.$mount()