index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <div>
  3. <h4>请稍候...</h4>
  4. </div>
  5. </template>
  6. <script>
  7. import { mapGetters, mapMutations } from 'vuex'
  8. import adminapi from '@/api/system/admin'
  9. import authutils from '@/utils/authutils'
  10. export default {
  11. name: 'index',
  12. props: [],
  13. data() {
  14. return {}
  15. },
  16. created() {
  17. let token = this.$route.query.token
  18. console.log(token)
  19. this.$store.commit('setSsoToken', token)
  20. console.log(this.$store.state.ssoToken)
  21. this.$store.dispatch('layout/loadUserInfo').then(resp => {
  22. console.log('store dispatch result ', resp)
  23. if (resp.result == 'success') {
  24. let lastRoute = this.$store.getters['lastRoute']
  25. console.log('last route ', lastRoute)
  26. if (lastRoute) {
  27. this.$router.replace(lastRoute)
  28. } else {
  29. this.$router.replace({path: "/"})
  30. }
  31. }else{
  32. this.$router.replace('/nouser')
  33. }
  34. })
  35. },
  36. mounted() {},
  37. components: {}
  38. }
  39. </script>