登陆没有账户的提醒

This commit is contained in:
Kunagisa 2025-05-29 16:24:16 +08:00
parent 1a45abc3ad
commit 7d77a11dee
2 changed files with 31 additions and 1 deletions

View File

@ -201,9 +201,13 @@ const handleLogin = async () => {
} }
} catch (error) { } catch (error) {
console.error('登录失败:', error) console.error('登录失败:', error)
if (error.response && error.response.status === 401) {
alert('错误的用户名或密码,或未注册')
} else {
alert(error.response?.data?.message || error.message || '登录失败,请稍后重试') alert(error.response?.data?.message || error.message || '登录失败,请稍后重试')
} }
} }
}
const validateForm = () => { const validateForm = () => {
if (!username.value || !password.value) { if (!username.value || !password.value) {

View File

@ -257,6 +257,32 @@ html, body, .dashboard-wrapper, .admin-layout {
width: 100%; 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 Styles */
.mobile-header { .mobile-header {
display: none; /* Hidden by default, shown on mobile */ display: none; /* Hidden by default, shown on mobile */