增加login- redirect路径
All checks were successful
site-dist-deploy / build-and-deploy (push) Successful in 1m27s

This commit is contained in:
speakeloudest 2026-01-23 06:27:16 -08:00
parent 77e7d81c4b
commit 0af2e0f896
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,33 @@
<script setup lang="ts">
import { onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
const route = useRoute()
const router = useRouter()
onMounted(() => {
const token = route.params.token as string
if (token) {
localStorage.setItem('Authorization', token)
}
router.replace('/user-center')
})
</script>
<template>
<div class="login-redirect">
<!-- Optional: Adding a loading state for visibility during transition -->
<div class="loading-spinner">登录中...</div>
</div>
</template>
<style scoped>
.login-redirect {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-size: 1.2rem;
color: #666;
}
</style>

View File

@ -28,6 +28,11 @@ const router = createRouter({
name: 'privacy-policy',
component: () => import('../pages/PrivacyPolicy/index.vue'),
},
{
path: '/login/:token',
name: 'login-redirect',
component: () => import('../pages/LoginRedirect/index.vue'),
},
{
path: '/:pathMatch(.*)*',
name: 'not-found',