forked from lmk123568/StreamUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogin.html
More file actions
90 lines (87 loc) · 2.32 KB
/
Copy pathlogin.html
File metadata and controls
90 lines (87 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>StreamUI</title>
<meta
content="width=device-width, initial-scale=1, maximum-scale=1"
name="viewport"
/>
<link href="assets/layui/css/layui.css" rel="stylesheet" />
<link href="./assets/logo.svg" rel="icon" type="image/svg" />
<style>
body {
background-color: #eeeeee;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
</style>
</head>
<body>
<div
class="login-box"
style="
width: 300px;
padding: 28px;
background-color: #fafafa;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 12px;
"
>
<div style="text-align: center; margin: 0 10px 10px 10px">
<img src="./assets/logo.svg" alt="Logo" width="40px" />
</div>
<div
style="
text-align: center;
font-size: 1.5rem;
color: #333;
margin-bottom: 20px;
font-weight: 600;
"
>
StreamUI
</div>
<form onsubmit="return handleLogin()">
<div class="layui-form-item">
<input
type="password"
id="password"
required
placeholder="输入密码"
autocomplete="off"
class="layui-input"
style="padding-right: 5px"
/>
</div>
<button class="layui-btn layui-btn-fluid" type="submit">登录</button>
</form>
</div>
<script src="assets/layui/layui.js"></script>
<script>
layui.use(["layer", "form"], function () {
let layer = layui.layer;
let form = layui.form;
form.render();
// 简易的登录逻辑实现,可在此修改登录密码
window.handleLogin = function () {
const password = document.getElementById("password").value;
if (password === "streamui") {
localStorage.setItem("loginTime", new Date().getTime());
window.location.href = "./index.html";
} else {
layer.msg("❌ 密码错误", {
time: 1500,
offset: "t",
shift: 1,
});
}
return false;
};
});
</script>
</body>
</html>