164 lines
4.5 KiB
HTML
164 lines
4.5 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>登录 - 企业运维告警监控平台</title>
|
|
<link rel="stylesheet" href="/static/css/font-awesome.min.css">
|
|
<script src="/static/js/jquery.min.js"></script>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
body {
|
|
background-color: #152c5b;
|
|
font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-height: 100vh;
|
|
}
|
|
.login-box {
|
|
background: #fff;
|
|
width: 420px;
|
|
padding: 40px 32px;
|
|
border-radius: 16px;
|
|
box-shadow: 0 8px 40px rgba(0,0,0,0.2);
|
|
}
|
|
.login-title {
|
|
text-align: center;
|
|
font-size: 24px;
|
|
color: #152c5b;
|
|
margin-bottom: 30px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 10px;
|
|
}
|
|
.login-title i {
|
|
color: #36d399;
|
|
font-size: 26px;
|
|
}
|
|
.input-item {
|
|
margin-bottom: 22px;
|
|
}
|
|
.input-item label {
|
|
display: block;
|
|
color: #475569;
|
|
margin-bottom: 8px;
|
|
font-size: 14px;
|
|
}
|
|
.input-wrap {
|
|
position: relative;
|
|
}
|
|
.input-wrap i {
|
|
position: absolute;
|
|
left: 14px;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
color: #94a3b8;
|
|
}
|
|
.input-wrap input {
|
|
width: 100%;
|
|
padding: 14px 14px 14px 42px;
|
|
border: 1px solid #e2e8f0;
|
|
border-radius: 8px;
|
|
font-size: 15px;
|
|
transition: border 0.2s;
|
|
}
|
|
.input-wrap input:focus {
|
|
outline: none;
|
|
border-color: #152c5b;
|
|
}
|
|
.login-btn {
|
|
width: 100%;
|
|
padding: 14px;
|
|
background-color: #152c5b;
|
|
color: #fff;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-size: 16px;
|
|
cursor: pointer;
|
|
transition: background 0.24s;
|
|
margin-top: 8px;
|
|
}
|
|
.login-btn:hover {
|
|
background-color: #0f1e42;
|
|
}
|
|
.msg-tip {
|
|
text-align: center;
|
|
margin-top: 16px;
|
|
font-size: 14px;
|
|
display: none;
|
|
}
|
|
.error {
|
|
color: #dc2626;
|
|
}
|
|
.success {
|
|
color: #16a34a;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="login-box">
|
|
<div class="login-title">
|
|
<i class="fa fa-bell"></i>
|
|
<span>企业运维告警监控平台</span>
|
|
</div>
|
|
<div class="input-item">
|
|
<label>访问密码</label>
|
|
<div class="input-wrap">
|
|
<i class="fa fa-lock"></i>
|
|
<input type="password" id="pwd" placeholder="请输入访问密码" autocomplete="off">
|
|
</div>
|
|
</div>
|
|
<button class="login-btn" id="loginBtn">登录进入平台</button>
|
|
<div class="msg-tip" id="tip"></div>
|
|
</div>
|
|
|
|
<script>
|
|
$(function(){
|
|
// 自定义登录密码,自行修改
|
|
const PASSWORD = "hp93000";
|
|
const TOKEN_KEY = "alert_admin_token";
|
|
|
|
// 已有登录凭证直接跳转首页
|
|
if(localStorage.getItem(TOKEN_KEY)){
|
|
window.location.href = "dashboard6.0.html";
|
|
}
|
|
|
|
function showTip(text, type="error"){
|
|
const $tip = $("#tip");
|
|
$tip.text(text).removeClass("error success").addClass(type).show();
|
|
setTimeout(()=>$tip.hide(),2500);
|
|
}
|
|
|
|
$("#loginBtn").click(function(){
|
|
const inputPwd = $("#pwd").val().trim();
|
|
if(!inputPwd){
|
|
showTip("请输入访问密码");
|
|
return;
|
|
}
|
|
if(inputPwd !== PASSWORD){
|
|
showTip("密码错误,请重新输入");
|
|
$("#pwd").val("");
|
|
return;
|
|
}
|
|
// 登录成功
|
|
localStorage.setItem(TOKEN_KEY, "login_success");
|
|
showTip("登录成功,正在跳转...", "success");
|
|
setTimeout(()=>{
|
|
window.location.href = "dashboard5.0.html";
|
|
},800);
|
|
});
|
|
// 回车登录
|
|
$("#pwd").keydown(function(e){
|
|
if(e.keyCode === 13) $("#loginBtn").click();
|
|
})
|
|
})
|
|
</script>
|
|
</body>
|
|
</html>
|