main.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. Vue.config.productionTip = false;
  5. //组件库
  6. import uView from '@/uni_modules/uview-ui'
  7. Vue.use(uView)
  8. //colorui 自定义顶部nav
  9. import cuCustom from './colorui/components/cu-custom.vue'
  10. Vue.component('cu-custom', cuCustom)
  11. import timeHorizon from './components/timeHorizon'
  12. Vue.component('time-horizon', timeHorizon)
  13. import controlItem from "./control/modules/controlItem.vue"
  14. Vue.component('control-item', controlItem)
  15. import My_input from "./control/modules/My_input.vue"
  16. Vue.component('My_input', My_input)
  17. //自定义组件
  18. import My_listbox from './components/My_listbox';
  19. Vue.component('My_listbox', My_listbox);
  20. import My_search from './components/My_search';
  21. Vue.component('My_search', My_search);
  22. import My_form from './components/My_form';
  23. Vue.component('My_form', My_form);
  24. import My_Files from './components/My_Files';
  25. Vue.component('My_Files', My_Files);
  26. //挂载接口
  27. let isDev = process.env.NODE_ENV === 'development';
  28. console.log('运行环境', isDev ? '开发' : '生产');
  29. const http = {};
  30. // #ifdef H5
  31. /* http.baseUrl = isDev ? "/apis1" : "/apis";
  32. http.socket = isDev ? "/socket1" : "/socket"; */
  33. http.baseUrl = "/apis";
  34. http.socket = "/socket";
  35. // #endif
  36. // #ifndef H5
  37. /* http.baseUrl = isDev ? "http://60.204.153.188" : "https://www.ibpchina.com.cn";
  38. http.socket = isDev ? "ws://60.204.153.188" : "wss://www.ibpchina.com.cn"; */
  39. http.baseUrl = "https://www.ibpchina.com.cn";
  40. http.socket = "wss://www.ibpchina.com.cn";
  41. // #endif
  42. console.log("接口地址", http)
  43. import {
  44. ApiModel
  45. } from './utils/api'
  46. Vue.prototype.$Http = new ApiModel(http);
  47. import {
  48. Socket
  49. } from './utils/Socket'
  50. Vue.prototype.$Socket = new Socket(http);
  51. App.mpType = 'app'
  52. const app = new Vue({
  53. ...App
  54. })
  55. app.$mount()
  56. // #endif
  57. // #ifdef VUE3
  58. import {
  59. createSSRApp
  60. } from 'vue'
  61. export function createApp() {
  62. const app = createSSRApp(App)
  63. return {
  64. app
  65. }
  66. }
  67. // #endif