49 lines
2.3 KiB
HTML
49 lines
2.3 KiB
HTML
{% load static %}
|
|
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>安全登录</title>
|
|
<link rel="preload" href="{% static 'accounts/login.js' %}" as="script">
|
|
<style>
|
|
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: #f5f6fa; }
|
|
.container { max-width: 360px; margin: 12vh auto; padding: 24px; background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
|
|
h1 { font-size: 20px; margin: 0 0 16px; }
|
|
label { display: block; margin: 12px 0 6px; color: #333; }
|
|
input { width: 100%; padding: 10px 12px; border: 1px solid #dcdde1; border-radius: 6px; }
|
|
button { width: 100%; margin-top: 16px; padding: 10px 12px; background: #2d8cf0; color: #fff; border: none; border-radius: 6px; cursor: pointer; }
|
|
button:disabled { background: #9bbcf0; cursor: not-allowed; }
|
|
.error { color: #d93025; margin-top: 10px; min-height: 20px; }
|
|
.hint { color: #888; font-size: 12px; margin-top: 10px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>登录到系统</h1>
|
|
<form id="loginForm">
|
|
{% csrf_token %}
|
|
<label for="username">账户</label>
|
|
<input id="username" name="username" type="text" autocomplete="username" required />
|
|
|
|
<label for="password">密码</label>
|
|
<input id="password" name="password" type="password" autocomplete="current-password" required />
|
|
|
|
<div id="captchaBox" style="display:none; margin-top:12px;">
|
|
<label for="captcha">验证码</label>
|
|
<div style="display:flex; gap:8px; align-items:center;">
|
|
<input id="captcha" name="captcha" type="text" autocomplete="off" style="flex:1;" />
|
|
<img id="captchaImg" alt="验证码" style="height:40px; border:1px solid #dcdde1; border-radius:6px;" />
|
|
<button id="refreshCaptcha" type="button" style="width:auto;">刷新</button>
|
|
</div>
|
|
</div>
|
|
|
|
<button id="loginBtn" type="submit">登录</button>
|
|
<div id="error" class="error"></div>
|
|
</form>
|
|
</div>
|
|
|
|
<script src="{% static 'accounts/login.js' %}"></script>
|
|
</body>
|
|
</html> |