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

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

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(() => {
  router.replace('/login')
})
</script>

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