<template>
  <div class="login-redirect">
    <!-- Optional: Adding a loading state for visibility during transition -->
    <div class="loading-spinner">登录中...</div>
  </div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { getQueryString } from '@/utils/url-utils.ts'
const router = useRouter()
onMounted(() => {
  const token = getQueryString('t')
  console.log(token)
  if (token) {
    localStorage.setItem('Authorization', token)
  }
  router.replace('/user-center')
})
</script>

<style scoped>
.login-redirect {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-size: 1.2rem;
  color: #666;
}
</style>
