index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. if (resp.Result == 'success') {
  25. let lastRoute = this.$store.getters['lastRoute']
  26. console.log('last route ', lastRoute)
  27. if (lastRoute) {
  28. this.$router.replace(lastRoute)
  29. } else {
  30. this.$router.replace({path: "/"})
  31. }
  32. }else{
  33. this.$router.replace('/nouser')
  34. }
  35. })
  36. },
  37. mounted() {},
  38. components: {}
  39. }
  40. </script>