Files
iAOP/web/auth/login.html
T

69 lines
3.0 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">
<title>iAOP 登录</title>
<style>
/* iAOP 登录页(issue #134 / PRD 8.2):深色主题对齐驾驶舱 */
body { margin:0; font-family:"Microsoft YaHei",sans-serif; background:#0b1220;
color:#e6edf6; display:flex; align-items:center; justify-content:center;
min-height:100vh; }
.card { background:#13203a; border:1px solid rgba(255,255,255,.06); border-radius:10px;
padding:28px 32px; width:340px; }
h1 { font-size:18px; color:#18d3c8; margin:0 0 4px; }
.sub { font-size:12px; color:#8aa0bd; margin-bottom:18px; }
label { display:block; font-size:13px; margin:12px 0 4px; }
input { width:100%; padding:9px 10px; border-radius:6px; border:1px solid rgba(255,255,255,.12);
background:#0b1220; color:#e6edf6; box-sizing:border-box; }
button { width:100%; margin-top:18px; padding:10px; border:none; border-radius:6px;
background:#18d3c8; color:#04202a; font-size:14px; cursor:pointer; }
#sso-btn { background:#1e293b; color:#e6edf6; margin-top:10px; }
.err { color:#ff3b30; font-size:12px; margin-top:10px; min-height:16px; }
.hint { font-size:11px; color:#64748b; margin-top:14px; }
</style>
</head>
<body>
<div class="card">
<h1>iAOP 平台登录</h1>
<div class="sub">本地账号 / 企业 IAM(SSO) 双轨 · PRD 8.2</div>
<label>用户名</label>
<input id="username" autocomplete="username" placeholder="admin">
<label>密码</label>
<input id="password" type="password" autocomplete="current-password" placeholder="admin123(首次内置)">
<button id="login-btn">登录</button>
<button id="sso-btn" hidden>企业 SSO 登录(OIDC)</button>
<div class="err" id="err"></div>
<div class="hint">首次运行内置管理员 admin / admin123,登录后请在用户管理页修改密码。<br>
SSO 未配置时仅本地账号可用;配置 OIDC(issuer/client_id)后此处出现 SSO 入口。</div>
</div>
<script src="auth.js"></script>
<script>
// 已登录则直接回跳
var next = new URLSearchParams(location.search).get("next") || "../studio/index.html";
Auth._ensureSeed().then(function () {
if (Auth.session()) location.href = next;
// OIDC 配置点:已配置则显示 SSO 入口(PRD 8.2 双轨)
var url = Auth.oidcAuthorizeUrl();
if (url) {
var btn = document.getElementById("sso-btn");
btn.hidden = false;
btn.onclick = function () { location.href = url; };
}
});
function doLogin() {
var err = document.getElementById("err");
err.textContent = "";
Auth.login(document.getElementById("username").value.trim(),
document.getElementById("password").value)
.then(function () { location.href = next; })
.catch(function (e) { err.textContent = e.message; });
}
document.getElementById("login-btn").onclick = doLogin;
document.getElementById("password").addEventListener("keydown", function (e) {
if (e.key === "Enter") doLogin();
});
</script>
</body>
</html>