main.js 2.2 KB

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