main.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import App from './App'
  2. import * as http from './utils/http' // http请求接口
  3. import * as utils from './utils/utils' // 工具文件
  4. import storage from 'utils/storage' // 缓存文件
  5. import config from '@/config' // 配置
  6. import MD5 from 'js-md5'
  7. import * as msg from './utils/msg' // 工具文件
  8. import _ from 'lodash'
  9. // import * as scanCode from '@/components/utils/scanCode'
  10. // ********** devapi *********
  11. import { DEVAPI } from "@/components/utils/scanCode"
  12. let devAPI = new DEVAPI()
  13. devAPI.initDevAPI()
  14. // import lodash
  15. Vue.prototype.$storage = storage
  16. Vue.prototype.$http = http
  17. Vue.prototype.$config = config
  18. Vue.prototype.$utils = utils
  19. Vue.prototype.$msg = msg
  20. // Vue.prototype.$scanCode = scanCode
  21. Vue.prototype.$md5 = MD5
  22. Vue.prototype.$scanAudio = uni.createInnerAudioContext();
  23. Vue.prototype.$devapi = devAPI; // 设备api
  24. Vue.prototype._ = _
  25. // #ifndef VUE3
  26. import Vue from 'vue'
  27. App.mpType = 'app'
  28. const app = new Vue({
  29. ...App
  30. })
  31. app.$mount()
  32. // #endif
  33. // #ifdef VUE3
  34. import { createSSRApp } from 'vue'
  35. export function createApp() {
  36. const app = createSSRApp(App)
  37. return {
  38. app
  39. }
  40. }
  41. // #endif