main.js 837 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // #ifndef VUE3
  2. import Vue from 'vue'
  3. import App from './App'
  4. import {
  5. ApiAppClient
  6. } from "./grpc/app_api_grpc_web_pb.js"
  7. import nfc from './utils/ouu-nfc.js'
  8. Vue.config.productionTip = false
  9. App.mpType = 'app'
  10. // 建立grpc连接服务
  11. // 测试版
  12. // let client = new ApiAppClient("http://192.168.0.3:10000", null, null)
  13. // let client = new ApiAppClient("http://t-otapi.beswell.com:10000", null, null)
  14. // 正式版
  15. let client = new ApiAppClient("http://otapi.beswell.com:10000", null, null)
  16. // 挂载为全局方法
  17. Vue.prototype.$client = client
  18. Vue.prototype.$nfc = nfc
  19. nfc.listenNFCStatus();
  20. const app = new Vue({
  21. ...App
  22. })
  23. app.$mount()
  24. // #endif
  25. // #ifdef VUE3
  26. import {
  27. createSSRApp
  28. } from 'vue'
  29. import App from './App.vue'
  30. export function createApp() {
  31. const app = createSSRApp(App)
  32. return {
  33. app
  34. }
  35. }
  36. // #endif