main.js 1.3 KB

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