main.js 2.2 KB

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