Files
gate_scout_order/onchain_scout_gate/templates/login.html
T
2026-05-30 16:01:35 +08:00

88 lines
3.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<script>
(function () {
if (window.matchMedia("(max-width: 640px), (hover: none) and (pointer: coarse)").matches) {
document.documentElement.classList.add("matrix-lite");
}
})();
</script>
<title>MATRIX · 接入</title>
<link rel="stylesheet" href="/static/style.css" />
</head>
<body class="matrix-login">
<div class="matrix-aurora" aria-hidden="true"></div>
<div class="matrix-vignette" aria-hidden="true"></div>
<div class="matrix-scanlines matrix-scanlines-strong" aria-hidden="true"></div>
<div class="matrix-noise" aria-hidden="true"></div>
<div class="matrix-grid-bg" aria-hidden="true"></div>
<div class="matrix-login-card matrix-login-card-chrome">
<div class="matrix-login-badge">SECURE CHANNEL</div>
<div class="matrix-login-glitch" data-text="&gt; AUTHENTICATE">&gt; AUTHENTICATE</div>
<p class="matrix-login-sub">MATRIX // GATE USDT PERP FUNNEL · 未授权区域禁止访问</p>
<form id="matrixLoginForm" method="post" action="/login" class="matrix-login-form">
<label class="matrix-label">操作员 ID</label>
<input class="matrix-input" type="text" name="username" required autocomplete="username" />
<label class="matrix-label">密钥</label>
<input class="matrix-input" type="password" name="password" required autocomplete="current-password" />
<button type="submit" class="matrix-btn matrix-btn-full matrix-btn-pulse">建立会话</button>
</form>
<div class="matrix-error" id="matrixLoginError">{{ error }}</div>
</div>
<script>
(function () {
var form = document.getElementById("matrixLoginForm");
var errEl = document.getElementById("matrixLoginError");
if (!form) return;
form.addEventListener("submit", function (e) {
e.preventDefault();
if (errEl) errEl.textContent = "";
var fd = new FormData(form);
var btn = form.querySelector('button[type="submit"]');
if (btn) btn.disabled = true;
fetch("/api/auth/login", {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
credentials: "same-origin",
body: JSON.stringify({
username: fd.get("username"),
password: fd.get("password"),
embed: window.self !== window.top ? "1" : "0",
}),
})
.then(function (r) {
return r.json().then(function (j) {
return { ok: r.ok, body: j };
});
})
.then(function (x) {
if (x.ok && x.body) {
var dest =
window.self !== window.top && x.body.embed_auth_url
? x.body.embed_auth_url
: x.body.redirect || "/dashboard";
if (dest) {
window.location.href = dest;
return;
}
}
if (errEl) {
errEl.textContent = (x.body && x.body.detail) || "登录失败";
}
})
.catch(function () {
if (errEl) errEl.textContent = "网络错误或会话 Cookie 被拦截(iframe 嵌入须 HTTPS + NAV_EMBED_ORIGINS";
})
.finally(function () {
if (btn) btn.disabled = false;
});
});
})();
</script>
</body>
</html>