微信

App.vue 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <div id="app" v-if="showPage">
  3. <router-view></router-view>
  4. </div>
  5. </template>
  6. <script>
  7. import '../../common/css/reset.css'
  8. import { mapState, createNamespacedHelpers } from 'vuex'
  9. const { mapActions: actions } = createNamespacedHelpers('userCenter')
  10. export default {
  11. name: 'app',
  12. data () {
  13. return {
  14. showPage: false
  15. }
  16. },
  17. computed: {
  18. ...mapState({
  19. userInfo: x => x.userCenter.userInfo,
  20. org: x => x.app.orgId
  21. })
  22. },
  23. created () {
  24. if (location.search && this.toolClass.UrlSearch(location.search).code) {
  25. this.code = this.toolClass.UrlSearch(location.search).code
  26. } else {
  27. this.code = null
  28. }
  29. this.getUserInfo({ org: this.org, code: this.code }).then(() => {
  30. this.showPage = true
  31. })
  32. },
  33. methods: {
  34. ...actions(['getUserInfo'])
  35. }
  36. }
  37. </script>
  38. <style>
  39. #app {
  40. width: 100%;
  41. height: 100%;
  42. position: relative;
  43. }
  44. </style>