main.js 2.2 KB

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