main.js 913 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. Vue.config.productionTip = false
  5. App.mpType = 'app'
  6. const app = new Vue({
  7. ...App
  8. })
  9. app.$mount()
  10. // #endif
  11. // #ifdef VUE3
  12. import { createSSRApp } from 'vue'
  13. export function createApp() {
  14. const app = createSSRApp(App)
  15. return {
  16. app
  17. }
  18. }
  19. // #endif
  20. import '@/commons/commons.css'
  21. Vue.prototype.$token = false
  22. Vue.prototype.$userInfo = null
  23. uni.getStorage({
  24. key: "userInfo",
  25. success(_data) {
  26. Vue.prototype.$userInfo = _data.data
  27. },
  28. fail() {
  29. Vue.prototype.$userInfo = null
  30. }
  31. })
  32. uni.getStorage({
  33. key: "Authorization",
  34. success(_data) {
  35. console.log(_data)
  36. Vue.prototype.$token = _data.data
  37. },
  38. fail() {
  39. Vue.prototype.$token = false
  40. }
  41. })
  42. import httpServer from "./util/http.js"
  43. Vue.prototype.$get = httpServer.get
  44. Vue.prototype.$post = httpServer.post
  45. import w_md5 from "js_sdk/zww-md5/w_md5.js"
  46. Vue.prototype.$w_md5 = w_md5;