Deploy to Production / pre-check (push) Successful in 58s
Deploy to Production / build (push) Successful in 4m3s
Deploy to Production / deploy-edgeone (push) Successful in 3m48s
Deploy to Production / finalize (push) Successful in 26s
Deploy to Production / notify-failure (push) Skipped
48 lines
2.3 KiB
HTML
48 lines
2.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>登录 · UAPI管理系统</title>
|
|
<style>
|
|
:root { --bg: #0d1117; --card: #161b22; --border: #30363d; --text: #c9d1d9; --muted: #8b949e; --accent: #58a6ff; }
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
|
|
.login-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 40px; width: 100%; max-width: 380px; text-align: center; }
|
|
.login-box h1 { font-size: 22px; margin-bottom: 8px; color: #fff; }
|
|
.login-box p { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
|
|
.login-box input { width: 100%; padding: 10px 14px; background: #0d1117; border: 1px solid var(--border); border-radius: 8px; color: #fff; font-size: 15px; outline: none; }
|
|
.login-box input:focus { border-color: var(--accent); }
|
|
.login-box button { width: 100%; margin-top: 14px; padding: 10px; background: #238636; color: #fff; border: none; border-radius: 8px; font-size: 15px; cursor: pointer; font-weight: 600; }
|
|
.login-box button:hover { background: #2ea043; }
|
|
.error { color: #f85149; font-size: 13px; margin-top: 10px; display: none; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="login-box">
|
|
<h1>UAPI管理系统</h1>
|
|
<p>请输入访问口令</p>
|
|
<input type="password" id="pwd" placeholder="口令" autofocus>
|
|
<button onclick="login()">进入</button>
|
|
<div class="error" id="err">口令错误</div>
|
|
</div>
|
|
<script>
|
|
async function login() {
|
|
const pwd = document.getElementById('pwd').value;
|
|
if (!pwd) return;
|
|
try {
|
|
const res = await fetch('/api/auth?token=' + encodeURIComponent(pwd));
|
|
if (res.ok) {
|
|
document.cookie = 'site_token=' + pwd + ';path=/;max-age=2592000;SameSite=Lax';
|
|
location.href = '/feed?token=' + encodeURIComponent(pwd);
|
|
} else {
|
|
document.getElementById('err').style.display = 'block';
|
|
}
|
|
} catch {
|
|
document.getElementById('err').style.display = 'block';
|
|
}
|
|
}
|
|
document.getElementById('pwd').addEventListener('keydown', (e) => { if (e.key === 'Enter') login(); });
|
|
</script>
|
|
</body>
|
|
</html> |