增加login- redirect路径
All checks were successful
site-dist-deploy / build-and-deploy (push) Successful in 1m27s
All checks were successful
site-dist-deploy / build-and-deploy (push) Successful in 1m27s
This commit is contained in:
parent
77e7d81c4b
commit
0af2e0f896
33
src/pages/LoginRedirect/index.vue
Normal file
33
src/pages/LoginRedirect/index.vue
Normal 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>
|
||||||
@ -28,6 +28,11 @@ const router = createRouter({
|
|||||||
name: 'privacy-policy',
|
name: 'privacy-policy',
|
||||||
component: () => import('../pages/PrivacyPolicy/index.vue'),
|
component: () => import('../pages/PrivacyPolicy/index.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/login/:token',
|
||||||
|
name: 'login-redirect',
|
||||||
|
component: () => import('../pages/LoginRedirect/index.vue'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/:pathMatch(.*)*',
|
path: '/:pathMatch(.*)*',
|
||||||
name: 'not-found',
|
name: 'not-found',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user