| @{ |
| ViewData["Title"] = "管理员登录"; |
| Layout = null; |
| } |
|
|
| <!DOCTYPE html> |
| <html lang="zh-CN"> |
| <head> |
| <meta charset="utf-8" /> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| <title>@ViewData["Title"] - ToolHub</title> |
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet" /> |
| <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet" /> |
| <link rel="stylesheet" href="~/css/toolhub.css" asp-append-version="true" /> |
| </head> |
| <body style="background: linear-gradient(135deg, var(--primary), var(--secondary)); min-height: 100vh; display: flex; align-items: center; justify-content: center;"> |
| <div class="container" style="max-width: 400px;"> |
| <div class="card" style="padding: 2rem; text-align: center;"> |
| |
| <div style="margin-bottom: 2rem;"> |
| <div class="brand-icon" style="margin: 0 auto 1rem;"> |
| <i class="fas fa-wrench"></i> |
| </div> |
| <h1 style="font-size: 1.5rem; font-weight: 700; margin: 0;"> |
| <span class="text-gradient">ToolHub</span> 管理后台 |
| </h1> |
| <p style="color: var(--dark-2); margin-top: 0.5rem;">请登录您的管理员账户</p> |
| </div> |
|
|
| |
| @if (ViewBag.Error != null) |
| { |
| <div style="background: rgba(255, 77, 79, 0.1); color: var(--danger); padding: 0.75rem; border-radius: var(--border-radius); margin-bottom: 1.5rem; border-left: 4px solid var(--danger);"> |
| <i class="fas fa-exclamation-circle" style="margin-right: 0.5rem;"></i> |
| @ViewBag.Error |
| </div> |
| } |
|
|
| |
| <form method="post" action="@Url.Action("Login", "Admin")"> |
| <div style="margin-bottom: 1.25rem;"> |
| <input type="email" |
| name="email" |
| placeholder="管理员邮箱" |
| required |
| style="width: 100%; padding: 0.875rem; border: 1px solid var(--light-2); border-radius: var(--border-radius); font-size: 0.875rem; transition: var(--transition);" |
| onfocus="this.style.borderColor='var(--primary)'; this.style.boxShadow='0 0 0 3px rgba(22, 93, 255, 0.1)'" |
| onblur="this.style.borderColor='var(--light-2)'; this.style.boxShadow='none'" /> |
| </div> |
|
|
| <div style="margin-bottom: 1.25rem;"> |
| <input type="password" |
| name="password" |
| placeholder="密码" |
| required |
| style="width: 100%; padding: 0.875rem; border: 1px solid var(--light-2); border-radius: var(--border-radius); font-size: 0.875rem; transition: var(--transition);" |
| onfocus="this.style.borderColor='var(--primary)'; this.style.boxShadow='0 0 0 3px rgba(22, 93, 255, 0.1)'" |
| onblur="this.style.borderColor='var(--light-2)'; this.style.boxShadow='none'" /> |
| </div> |
|
|
| <div style="margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem;"> |
| <input type="checkbox" name="rememberMe" id="rememberMe" value="true" /> |
| <label for="rememberMe" style="font-size: 0.875rem; color: var(--dark-2); cursor: pointer;"> |
| 记住我 |
| </label> |
| </div> |
|
|
| <button type="submit" class="btn btn-primary" style="width: 100%; padding: 0.875rem; font-weight: 600;"> |
| <i class="fas fa-sign-in-alt" style="margin-right: 0.5rem;"></i> |
| 登录 |
| </button> |
| </form> |
|
|
| |
| <div style="margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--light-2);"> |
| <p style="font-size: 0.75rem; color: var(--dark-2); margin: 0;"> |
| <i class="fas fa-shield-alt" style="margin-right: 0.25rem;"></i> |
| 默认管理员账户:admin@toolhub.com / admin123 |
| </p> |
| <p style="font-size: 0.75rem; color: var(--dark-2); margin: 0.5rem 0 0;"> |
| <a href="@Url.Action("Index", "Home")" style="color: var(--primary); text-decoration: none;"> |
| <i class="fas fa-arrow-left" style="margin-right: 0.25rem;"></i> |
| 返回首页 |
| </a> |
| </p> |
| </div> |
| </div> |
| </div> |
|
|
| <script> |
| |
| document.querySelector('form').addEventListener('submit', function(e) { |
| const email = this.email.value.trim(); |
| const password = this.password.value.trim(); |
| |
| if (!email || !password) { |
| e.preventDefault(); |
| alert('请填写完整的登录信息'); |
| } |
| }); |
| </script> |
| </body> |
| </html> |
|
|