index.vue 602 B

12345678910111213141516171819202122232425262728
  1. <template>
  2. <div class="boot" v-loading="true"></div>
  3. </template>
  4. <script lang="ts" setup>
  5. import { useRoute, useRouter } from 'vue-router'
  6. import { useLogin } from '@/business/login'
  7. import eventBus from '@/services/bus'
  8. const { initBaseData } = useLogin()
  9. const route = useRoute()
  10. const router = useRouter()
  11. initBaseData().then(() => {
  12. const redirect = route.query.redirect
  13. if (redirect) {
  14. router.replace(redirect.toString())
  15. } else {
  16. router.replace('/')
  17. }
  18. }).catch(() => {
  19. eventBus.$emit('LogoutNotify')
  20. })
  21. </script>
  22. <style lang="less" scoped>
  23. @import './index.less';
  24. </style>