<template>
    <div>
        <h4>请稍候...</h4>
    </div>
</template>
<script>
import { mapGetters, mapMutations } from 'vuex'
import adminapi from '@/api/system/admin'
import authutils from '@/utils/authutils'
export default {
    name: 'index',
    props: [],
    data() {
        return {}
    },
    created() {
        let token = this.$route.query.token
        console.log(token)
        this.$store.commit('setSsoToken', token)   
        console.log(this.$store.state.ssoToken)         
        this.$store.dispatch('layout/loadUserInfo').then(resp => {
            console.log('store dispatch result ', resp)
            // if (resp.result  == 'success') {
            if (resp.Result  == 'success') {
                let lastRoute = this.$store.getters['lastRoute']
                console.log('last route ', lastRoute)
                if (lastRoute) {
                    this.$router.replace(lastRoute)
                } else {
                    this.$router.replace({path: "/"})
                }
            }else{
                this.$router.replace('/nouser')
            }
        })
    },
    mounted() {},
    components: {}
}
</script>
