main.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import App from "./App";
  2. import store from "./store";
  3. import{isJobExls} from '@/utils/common.js'
  4. Vue.prototype.$store = store;
  5. Vue.prototype.$isAuthorities = (authorities)=>{
  6. try {
  7. let authoritiesLiat=uni.getStorageSync('authorities') //按钮
  8. let authoritiesCode=JSON.parse(authoritiesLiat).map(item=>item.permissionCode)
  9. console.log(authoritiesCode,'authoritiesCode')
  10. return authoritiesCode.includes(authorities)
  11. } catch (error) {
  12. //TODO handle the exception
  13. }
  14. return true
  15. };
  16. Vue.prototype.$isJobExls = isJobExls;
  17. // uView配置
  18. import uView from "@/uni_modules/uview-ui";
  19. Vue.use(uView);
  20. uni.$u.config.unit = "rpx";
  21. // Vue.prototype.apiUrl = "http://10.34.48.105:81";
  22. // Vue.prototype.apiUrl = "http://192.168.1.100:9090";
  23. // #ifdef APP-PLUS
  24. Vue.prototype.apiUrl = "";
  25. // const apiInfo = uni.getStorageSync("apiInfo");
  26. // Vue.prototype.apiWebUrl = `${apiInfo.protocal}${apiInfo.hostname}:${apiInfo.port}/api`;
  27. // Vue.prototype.apiUrl = `${apiInfo.protocal}${apiInfo.hostname}:${apiInfo.port}/api`;
  28. // 测试
  29. // Vue.prototype.apiWebUrl = ''
  30. // Vue.prototype.apiUrl = "http://192.168.3.35:8080/api";
  31. // Vue.prototype.apiWebUrl = "http://192.168.3.51:18086/api"; //本地测试
  32. // Vue.prototype.apiUrl = 'http://192.168.3.38:8601/api' //本地测试
  33. // Vue.prototype.apiWebUrl = 'http://124.71.68.31:81/api'
  34. // Vue.prototype.apiUrl = 'http://124.71.68.31:81/api'
  35. // 生产
  36. /* Vue.prototype.apiWebUrl = 'http://10.34.48.105:81/web';
  37. Vue.prototype.apiUrl = 'http://10.34.48.105:81/api'; */
  38. // 测试
  39. // Vue.prototype.apiWebUrl = 'http://192.168.3.19:8601';
  40. // Vue.prototype.apiUrl = 'http://192.168.3.19:8601';
  41. // #endif
  42. // #ifdef H5
  43. Vue.prototype.apiUrl = "/api";
  44. Vue.prototype.apiWebUrl = "/web";
  45. // Vue.prototype.apiWebUrl = 'http://192.168.3.19:8601/web';
  46. // Vue.prototype.apiUrl = 'http://192.168.3.19:8601/api';
  47. // Vue.prototype.apiWebUrl = 'http://10.34.48.105:80/web';
  48. // Vue.prototype.apiUrl = 'http://10.34.48.105:80/api';
  49. // #endif
  50. // #ifndef VUE3
  51. import Vue from "vue";
  52. import "./utils/minxin.js";
  53. Vue.config.productionTip = false;
  54. App.mpType = "app";
  55. const app = new Vue({
  56. ...App,
  57. store,
  58. });
  59. app.$mount();
  60. // #endif
  61. // #ifdef VUE3
  62. import { createSSRApp } from "vue";
  63. export function createApp() {
  64. const app = createSSRApp(App);
  65. app.use(store);
  66. return {
  67. app,
  68. };
  69. }
  70. // #endif