main.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import App from './App'
  2. import uView from "uview-ui";
  3. // #ifndef VUE3
  4. import Vue from 'vue'
  5. import './uni.promisify.adaptor'
  6. Vue.config.productionTip = false
  7. Vue.use(uView);
  8. //自定义组件
  9. import My_listbox from './components/My_listbox.vue';
  10. Vue.component("My_listbox", My_listbox);
  11. import appList from './components/appList.vue';
  12. Vue.component("appList", appList);
  13. //挂载接口
  14. let isDev = process.env.NODE_ENV === 'development';
  15. console.log('运行环境' + process.env.NODE_ENV, isDev ? '开发' : '生产');
  16. const http = {};
  17. // #ifdef H5
  18. http.baseUrl = isDev ? "/apis1" : "/apis";
  19. http.socket = isDev ? "/socket1" : "/socket";
  20. // #endif
  21. // #ifndef H5
  22. http.baseUrl = isDev ? "http://61.164.207.46:8200" : "https://www.ibpchina.com.cn";
  23. http.socket = isDev ? "ws://61.164.207.46:8200" : "wss://www.ibpchina.com.cn";
  24. // #endif
  25. console.log("接口地址", http)
  26. import {
  27. ApiModel
  28. } from './utils/api'
  29. Vue.prototype.$Http = new ApiModel(http);
  30. App.mpType = 'app'
  31. const app = new Vue({
  32. ...App
  33. })
  34. app.$mount()
  35. // #endif
  36. // #ifdef VUE3
  37. import {
  38. createSSRApp
  39. } from 'vue'
  40. export function createApp() {
  41. const app = createSSRApp(App)
  42. return {
  43. app
  44. }
  45. }
  46. // #endif