diff --git a/dashboard/src/assets/images/astrbot_logo_mini.webp b/dashboard/src/assets/images/astrbot_logo_mini.webp new file mode 100644 index 000000000..f6a868c54 Binary files /dev/null and b/dashboard/src/assets/images/astrbot_logo_mini.webp differ diff --git a/dashboard/src/components/shared/Logo.vue b/dashboard/src/components/shared/Logo.vue new file mode 100644 index 000000000..294fae094 --- /dev/null +++ b/dashboard/src/components/shared/Logo.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/dashboard/src/router/index.ts b/dashboard/src/router/index.ts index a56154f18..c44e0249d 100644 --- a/dashboard/src/router/index.ts +++ b/dashboard/src/router/index.ts @@ -24,6 +24,11 @@ router.beforeEach(async (to, from, next) => { const authRequired = !publicPages.includes(to.path); const auth: AuthStore = useAuthStore(); + // 如果用户已登录且试图访问登录页面,则重定向到首页或之前尝试访问的页面 + if (to.path === '/auth/login' && auth.has_token()) { + return next(auth.returnUrl || '/'); + } + if (to.matched.some((record) => record.meta.requiresAuth)) { if (authRequired && !auth.has_token()) { auth.returnUrl = to.fullPath; diff --git a/dashboard/src/views/authentication/auth/LoginPage.vue b/dashboard/src/views/authentication/auth/LoginPage.vue index 63a1f809c..4bcefe07c 100644 --- a/dashboard/src/views/authentication/auth/LoginPage.vue +++ b/dashboard/src/views/authentication/auth/LoginPage.vue @@ -1,23 +1,111 @@ +