main.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import App from './App'
  2. import store from './store'
  3. import common from './pages/utils/common.js'
  4. import constant from './pages/utils/constant.js'
  5. Vue.prototype.$gaodeKey = 'OJ7BZ-ULH6V-XBLPV-ULIMK-APS3H-QHFIP'; //高德地图key
  6. import {
  7. showToast,
  8. transDate
  9. } from './js_sdk/common.js'
  10. // #ifndef VUE3
  11. import Vue from 'vue'
  12. import auth from './js_sdk/auth'
  13. Vue.prototype.$auth = auth
  14. // import "./vite.config"
  15. Vue.prototype.$constant = constant
  16. Vue.prototype.$common = common
  17. Vue.config.productionTip = false
  18. Vue.prototype.$store = store
  19. Vue.prototype.$transDate = transDate
  20. Vue.prototype.$showToast = showToast
  21. import $http from './js_sdk/request/requestConfig';
  22. Vue.prototype.$http = $http;
  23. // 全局引入 是否登录判断
  24. // uni.getStorage({
  25. // key: 'laocui_user_token',
  26. // success: function (res) {
  27. // uni.switchTab({
  28. // url: "/pages/index/index"
  29. // })
  30. // },
  31. // fail(res) {
  32. // uni.showToast({
  33. // title: "请重新登陆",
  34. // mask: true,
  35. // icon: "none"
  36. // });
  37. // uni.redirectTo({
  38. // url: "/pages/login/login"
  39. // })
  40. // }
  41. // });
  42. App.mpType = 'app'
  43. const app = new Vue({
  44. store,
  45. ...App
  46. })
  47. app.$mount()
  48. // #endif
  49. // #ifdef VUE3
  50. import {
  51. createSSRApp
  52. } from 'vue'
  53. export function createApp() {
  54. const app = createSSRApp(App)
  55. app.use(store)
  56. app.config.globalProperties.$adpid = "1111111111"
  57. app.config.globalProperties.$backgroundAudioData = {
  58. playing: false,
  59. playTime: 0,
  60. formatedPlayTime: '00:00:00'
  61. }
  62. return {
  63. app
  64. }
  65. }
  66. // #endif