1.登录验证

2.自动打开默认浏览器
This commit is contained in:
DelLevin-Home
2026-06-16 03:46:21 +08:00
parent 3c78293f4d
commit 2e05854f9d
5 changed files with 128 additions and 9 deletions

View File

@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{{ url_for('static', filename='font-awesome.css') }}">
<title>登录</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background: #f5f5f5; color: #333;
display: flex; align-items: center; justify-content: center;
min-height: 100vh;
}
.login-card {
background: #fff; border-radius: 12px; padding: 40px 36px;
width: 380px; box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.login-card h1 {
font-size: 20px; font-weight: 700; color: #1a1a1a;
text-align: center; margin-bottom: 6px;
}
.login-card .subtitle {
text-align: center; font-size: 13px; color: #999; margin-bottom: 28px;
}
.input-group { margin-bottom: 16px; }
.input-group label {
display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 6px;
}
.input-group input {
width: 100%; padding: 10px 12px; border: 1px solid #e0e0e0; border-radius: 8px;
font-size: 14px; outline: none; transition: border-color 0.15s;
}
.input-group input:focus { border-color: #0078d4; box-shadow: 0 0 0 2px rgba(0,120,212,0.06); }
.login-btn {
width: 100%; padding: 11px 0; margin-top: 8px;
background: linear-gradient(135deg, #0078d4, #005fa3);
color: #fff; border: none; border-radius: 8px;
font-size: 14px; font-weight: 600; cursor: pointer;
transition: all 0.15s;
}
.login-btn:hover {
background: linear-gradient(135deg, #006cbd, #004e8a);
box-shadow: 0 4px 12px rgba(0,120,212,0.25); transform: translateY(-1px);
}
.login-btn:active { transform: translateY(0); }
.error-msg {
background: #fce4ec; color: #c62828; border: 1px solid #f8bbd0;
border-radius: 6px; padding: 8px 12px; font-size: 13px;
text-align: center; margin-bottom: 16px;
}
</style>
</head>
<body>
<div class="login-card">
<h1><i class="fas fa-wrench" style="color:#0078d4; margin-right:6px;"></i>工具集管理后台</h1>
<p class="subtitle">请登录以继续使用</p>
{% if error %}
<div class="error-msg">{{ error }}</div>
{% endif %}
<form method="POST" action="/login">
<div class="input-group">
<label>用户名</label>
<input type="text" name="username" placeholder="请输入用户名" autofocus required>
</div>
<div class="input-group">
<label>密码</label>
<input type="password" name="password" placeholder="请输入密码" required>
</div>
<button type="submit" class="login-btn"><i class="fas fa-right-to-bracket"></i> 登 录</button>
</form>
</div>
</body>
</html>