<template>
  <div class="boot" v-loading="true"></div>
</template>

<script lang="ts" setup>
import { useRoute, useRouter } from 'vue-router'
import { useLogin } from '@/business/login'
import eventBus from '@/services/bus'

const { initBaseData } = useLogin()
const route = useRoute()
const router = useRouter()

initBaseData().then(() => {
  const redirect = route.query.redirect
  if (redirect) {
    router.replace(redirect.toString())
  } else {
    router.replace('/')
  }
}).catch(() => {
  eventBus.$emit('LogoutNotify')
})
</script>

<style lang="less" scoped>
@import './index.less';
</style>