main.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // #ifndef VUE3
  2. import Vue from 'vue'
  3. import App from './App'
  4. import {
  5. ApiToPromiseClient
  6. } from "./grpc/track_offical_grpc_web_pb.js"
  7. Vue.config.productionTip = false
  8. App.mpType = 'app'
  9. // 建立grpc连接服务
  10. // 测试版
  11. let client = new ApiToPromiseClient("http://192.168.0.3:10000", null, null)
  12. // 正式版
  13. // let client = new ApiAssClient("http://otapi.beswell.com:10000", null, null)
  14. // 挂载为全局方法
  15. Vue.prototype.$client = client
  16. // #ifdef APP-PLUS
  17. // import { usqlite } from '@/uni_modules/onemue-USQLite/js_sdk/usqlite.js'
  18. import SqliteHelper from './utils/SqliteHelper.js'
  19. import nfc from './utils/ouu-nfc.js'
  20. Vue.prototype.$dbHelper = SqliteHelper
  21. Vue.prototype.$nfc = nfc
  22. nfc.listenNFCStatus();
  23. // #endif
  24. // #ifdef H5
  25. import IndexedDB from '@/utils/IndexedDB'
  26. Vue.prototype.$dbHelper = IndexedDB
  27. // #endif
  28. const app = new Vue({
  29. ...App
  30. })
  31. app.$mount()
  32. // #endif
  33. // #ifdef VUE3
  34. import {
  35. createSSRApp
  36. } from 'vue'
  37. import App from './App.vue'
  38. export function createApp() {
  39. const app = createSSRApp(App)
  40. return {
  41. app
  42. }
  43. }
  44. // #endif