From 7d77a11dee47be95f77abd84b37061b3887b5f94 Mon Sep 17 00:00:00 2001 From: Kunagisa <1549184870@qq.com> Date: Thu, 29 May 2025 16:24:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E9=99=86=E6=B2=A1=E6=9C=89=E8=B4=A6?= =?UTF-8?q?=E6=88=B7=E7=9A=84=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/login_module.vue | 6 +++++- src/views/backend/Dashboard.vue | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/components/login_module.vue b/src/components/login_module.vue index 0b1b108..91a2a81 100644 --- a/src/components/login_module.vue +++ b/src/components/login_module.vue @@ -201,7 +201,11 @@ const handleLogin = async () => { } } catch (error) { console.error('登录失败:', error) - alert(error.response?.data?.message || error.message || '登录失败,请稍后重试') + if (error.response && error.response.status === 401) { + alert('错误的用户名或密码,或未注册') + } else { + alert(error.response?.data?.message || error.message || '登录失败,请稍后重试') + } } } diff --git a/src/views/backend/Dashboard.vue b/src/views/backend/Dashboard.vue index 1b9d43d..c64125a 100644 --- a/src/views/backend/Dashboard.vue +++ b/src/views/backend/Dashboard.vue @@ -257,6 +257,32 @@ html, body, .dashboard-wrapper, .admin-layout { width: 100%; } +.non-admin-view .button-group button { + padding: 10px 20px; + border-radius: 6px; + font-weight: 500; + transition: background-color 0.2s; + border: none; + color: #fff; + cursor: pointer; + margin: 8px; /* Provides spacing around buttons, e.g., 8px top/bottom, 8px left/right */ + min-width: 120px; /* Ensure buttons have a decent minimum width */ +} + +.non-admin-view .button-group .home-button { + background-color: #0ea5e9; /* Sky blue */ +} +.non-admin-view .button-group .home-button:hover { + background-color: #0284c7; /* Darker sky blue */ +} + +.non-admin-view .button-group .logout-button { + background-color: #ef4444; /* Red */ +} +.non-admin-view .button-group .logout-button:hover { + background-color: #dc2626; /* Darker Red */ +} + /* Mobile Header Styles */ .mobile-header { display: none; /* Hidden by default, shown on mobile */