main.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import App from './App'
  2. import common from '@/utils/common.js'
  3. Vue.prototype.$common =common
  4. import request from '@/utils/request.js'
  5. Vue.prototype.$http = request.http
  6. Vue.prototype.$request =request
  7. import store from './store'
  8. Vue.prototype.$store = store // 定义成全局组件
  9. //http://112.124.69.194:93/#/ 测试地址
  10. console.log("main.js")
  11. if(common.getHashQuery('token')){
  12. var userInfo={
  13. token:common.getHashQuery('token'),
  14. uid:common.getHashQuery('uid')
  15. }
  16. var wxOpenData={
  17. loginInfo:userInfo
  18. }
  19. console.log(wxOpenData)
  20. store.commit('mutationsuserInfo', userInfo)
  21. store.commit('mutationswxOpenData', wxOpenData)
  22. uni.setStorage({
  23. key: 'wxOpenData',
  24. data: wxOpenData,
  25. success: function () {
  26. }
  27. });
  28. console.log(store.state.userInfo)
  29. }
  30. if(common.getHashQuery('quanxian')){
  31. console.log(common.getHashQuery('quanxian'));
  32. uni.setStorage({
  33. key: 'quanxian',
  34. data: common.getHashQuery('quanxian'),
  35. success: function () { }
  36. });
  37. }
  38. //console.log(common.getHashQuery('token'))
  39. // #ifndef VUE3
  40. import Vue from 'vue'
  41. Vue.config.productionTip = false
  42. App.mpType = 'app'
  43. const app = new Vue({
  44. ...App
  45. })
  46. app.$mount()
  47. // #endif
  48. // #ifdef VUE3
  49. import { createSSRApp } from 'vue'
  50. export function createApp() {
  51. const app = createSSRApp(App)
  52. return {
  53. app
  54. }
  55. }
  56. // #endif