<template>
  <div>
    <h4>请稍候...</h4>
  </div>
</template>
<script>
// import { mapGetters, mapMutations } from 'vuex'
// import authutils from '@/utils/authutils'
import lStorage from '@/utils/localStorage'

export default {
  name: 'index',
  props: [],
  data() {
    return {}
  },
  created() {
    /**自研 */
    let token = this.$route.query.token;
    this.$store.commit('setSsoToken', token);
    lStorage.set('ssoToken', token);

    /**
     * 根据Token获取项目
     */
    this.$store.dispatch('layout/loadUserInfo').then(resp => {
        console.log('store dispatch result ', resp)
        if (resp.code  == 'Success') {
            // let lastRoute = this.$store.getters['lastRoute']
            // console.log('last route ', lastRoute)
            // if (lastRoute) {
            //     this.$router.replace(lastRoute)
            // } else {
            //     this.$router.replace({path: "/"})
            // }
            this.$router.replace({path: "/"})
        }else{
            this.$router.replace({path: '/nouser', query: {message: resp.message}})
        }
    })
  },
  mounted() {
  },
  components: {}
}
</script>
