From fd1b14fd1dab40bd8a814702ef21af7d826b1fc9 Mon Sep 17 00:00:00 2001 From: Edric Li Date: Thu, 8 Jan 2026 21:26:00 +0800 Subject: [PATCH] feat(home): redirect admin users to admin dashboard When clicking "Enter Console" button on home page, admin users are now redirected to /admin/dashboard instead of /dashboard. --- frontend/src/views/HomeView.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/HomeView.vue b/frontend/src/views/HomeView.vue index a06949a8..7f0994ca 100644 --- a/frontend/src/views/HomeView.vue +++ b/frontend/src/views/HomeView.vue @@ -61,7 +61,7 @@
{{ isAuthenticated ? t('home.goToDashboard') : t('home.getStarted') }} @@ -416,6 +416,8 @@ const githubUrl = 'https://github.com/Wei-Shaw/sub2api' // Auth state const isAuthenticated = computed(() => authStore.isAuthenticated) +const isAdmin = computed(() => authStore.isAdmin) +const dashboardPath = computed(() => isAdmin.value ? '/admin/dashboard' : '/dashboard') const userInitial = computed(() => { const user = authStore.user if (!user || !user.email) return ''