81 lines
3.4 KiB
HTML
81 lines
3.4 KiB
HTML
<!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="> AUTHENTICATE">> 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"),
|
||
}),
|
||
})
|
||
.then(function (r) {
|
||
return r.json().then(function (j) {
|
||
return { ok: r.ok, body: j };
|
||
});
|
||
})
|
||
.then(function (x) {
|
||
if (x.ok && x.body && x.body.redirect) {
|
||
window.location.href = x.body.redirect;
|
||
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>
|