main.js 1.2 KB

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