main.js 837 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import Vue from 'vue'
  2. import App from './App'
  3. import store from './store'
  4. import uView from "uview-ui"
  5. Vue.use(uView)
  6. Vue.config.productionTip = false
  7. let vuexStore = require("@/store/$u.mixin.js")
  8. Vue.mixin(vuexStore)
  9. App.mpType = 'mini'
  10. /**
  11. * 权限检查
  12. */
  13. Vue.prototype.$hasPermissions = function (value) {
  14. let isExist = false;
  15. if(!store.state.hasLogin){
  16. return true
  17. }
  18. let permissionsStr = uni.getStorageSync('permCodes');
  19. if (permissionsStr == undefined || permissionsStr == null || !permissionsStr) {
  20. return false;
  21. }
  22. let has = permissionsStr.find(item => {
  23. return item == value
  24. })
  25. if (has) {
  26. isExist = true;
  27. }
  28. return isExist;
  29. }
  30. /*
  31. * 打电话
  32. */
  33. Vue.prototype.callPhone = function (phone) {
  34. uni.makePhoneCall({
  35. phoneNumber: phone
  36. });
  37. }
  38. const app = new Vue({
  39. store,
  40. ...App
  41. })
  42. app.$mount()