better-staridc-MNBT
1<?php mnbt_admin_include('head'); ?>
2<style>
3html, body {
4 height: 100%;
5}
6body.login-page {
7 margin: 0;
8 min-height: 100vh;
9 display: flex;
10 align-items: center;
11 justify-content: center;
12 padding: 24px 16px;
13 background: #f4f6f8;
14 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
15}
16.login-wrap {
17 width: 100%;
18 max-width: 400px;
19}
20.login-card {
21 background: #fff;
22 border-radius: 16px;
23 padding: 40px 32px 28px;
24 box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
25 border: 1px solid #eef1f4;
26}
27.login-brand {
28 text-align: center;
29 margin-bottom: 28px;
30}
31.login-brand img {
32 max-height: 48px;
33 max-width: 200px;
34 object-fit: contain;
35}
36.login-brand .title {
37 margin: 14px 0 0;
38 font-size: 18px;
39 font-weight: 600;
40 color: #1e293b;
41 letter-spacing: -0.01em;
42}
43.login-brand .sub {
44 margin: 6px 0 0;
45 font-size: 13px;
46 color: #94a3b8;
47}
48.login-form .form-group {
49 margin-bottom: 16px;
50}
51.login-form .form-control {
52 height: 44px;
53 border-radius: 10px;
54 border: 1px solid #e2e8f0;
55 background: #f8fafc;
56 color: #1e293b;
57 padding: 0 14px 0 40px;
58 font-size: 14px;
59 box-shadow: none;
60 transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
61}
62.login-form .form-control:focus {
63 background: #fff;
64 border-color: #33cabb;
65 box-shadow: 0 0 0 3px rgba(51, 202, 187, 0.15);
66 outline: none;
67}
68.login-form .form-control::placeholder {
69 color: #94a3b8;
70}
71.login-form .has-feedback {
72 position: relative;
73}
74.login-form .has-feedback .mdi {
75 position: absolute;
76 left: 0;
77 top: 0;
78 width: 40px;
79 height: 44px;
80 line-height: 44px;
81 text-align: center;
82 color: #94a3b8;
83 z-index: 2;
84 pointer-events: none;
85}
86.login-form .has-feedback.row .mdi {
87 left: 15px;
88}
89.login-form .captcha-row {
90 display: flex;
91 gap: 10px;
92 align-items: stretch;
93}
94.login-form .captcha-row .captcha-input {
95 flex: 1;
96 min-width: 0;
97}
98.login-form .captcha-img {
99 height: 44px;
100 border-radius: 10px;
101 border: 1px solid #e2e8f0;
102 cursor: pointer;
103 flex-shrink: 0;
104}
105.login-form .btn-login {
106 height: 44px;
107 border-radius: 10px;
108 border: none;
109 background: #33cabb;
110 color: #fff;
111 font-size: 15px;
112 font-weight: 600;
113 width: 100%;
114 margin-top: 4px;
115 transition: background .15s ease, transform .1s ease;
116}
117.login-form .btn-login:hover,
118.login-form .btn-login:focus {
119 background: #2bb3a5;
120 color: #fff;
121}
122.login-form .btn-login:active {
123 transform: scale(0.99);
124}
125@media (max-width: 420px) {
126 .login-card {
127 padding: 32px 20px 24px;
128 }
129}
130</style>
131</head>
132<body class="login-page">
133<div class="login-wrap">
134 <div class="login-card">
135 <div class="login-brand">
136 <a href="./">
137 <img alt="MNBT admin" src="<?=mnbt_asset_url('admin_logo/logo.login.png')?>?1">
138 </a>
139 <p class="title">管理后台</p>
140 <p class="sub">管理员登录</p>
141 </div>
142 <form class="login-form" onsubmit="return false;">
143 <div class="form-group has-feedback">
144 <span class="mdi mdi-account" aria-hidden="true"></span>
145 <input type="text" class="form-control" id="username" placeholder="用户名" autocomplete="username">
146 </div>
147 <div class="form-group has-feedback">
148 <span class="mdi mdi-lock" aria-hidden="true"></span>
149 <input type="password" class="form-control" id="password" placeholder="密码" autocomplete="current-password">
150 </div>
151<?php if ($conf['yzm'] == 'true') { ?>
152 <div class="form-group">
153 <div class="captcha-row">
154 <div class="captcha-input has-feedback">
155 <span class="mdi mdi-check-all" aria-hidden="true"></span>
156 <input type="text" name="captcha" id="csyzmiq" class="form-control" placeholder="验证码" autocomplete="off">
157 </div>
158 <img src="./code.php?r=<?php echo time(); ?>" class="captcha-img" id="captcha" style="cursor:pointer;" onclick="this.src='./code.php?r='+Math.random();" title="点击刷新" alt="验证码">
159 </div>
160 </div>
161<?php } ?>
162 <div class="form-group mb-0">
163 <button class="btn btn-login" type="button" id="example-three" onclick="chkre()">登 录</button>
164 </div>
165 </form>
166 </div>
167</div>
168<script type="text/javascript">
169function chkre() {
170 var userq = username.value;
171 var passq = password.value;
172<?php if ($conf['yzm'] == 'true') { ?>
173 var codeq = csyzmiq.value;
174 if (userq == "" || passq == "" || codeq == "") {
175 msalert(4, '请将表单填写完整!', 2000);
176 return;
177 }
178<?php } else { ?>
179 if (userq == "" || passq == "") {
180 msalert(4, '请将表单填写完整!', 2000);
181 return;
182 }
183 var codeq = '0000';
184<?php } ?>
185 msloading('正在登录中,请稍后...', 'text-info', 'text-info');
186 var data = {};
187 data["gn"] = "login";
188 data["user"] = userq;
189 data["pass"] = passq;
190<?php if ($conf['yzm'] == 'true') { ?>
191 data["code"] = codeq;
192<?php } ?>
193 $.post('./ajax.php', data, function (date) {
194 var jsoe = JSON.parse(date);
195 var qk = jsoe.code;
196 if (qk == '登陆成功') {
197 msalert(1, '登录成功,正在跳转…', 2000);
198 window.location.href = "./index.php";
199 msloadingde();
200<?php if ($conf['yzm'] == 'true') { ?>
201 captcha.src = './code.php?r=' + Math.random();
202<?php } ?>
203 } else {
204 msalert(4, qk, 2000);
205 msloadingde();
206<?php if ($conf['yzm'] == 'true') { ?>
207 captcha.src = './code.php?r=' + Math.random();
208<?php } ?>
209 }
210 });
211}
212document.addEventListener('keydown', function (e) {
213 if (e.key === 'Enter') chkre();
214});
215</script>
216</body>
217</html>