新增navcat解密工具、优化后台UI

This commit is contained in:
MasonLiu committed 2026-09-12 01:36:59 +08:00
1 parent 7b3d45b153
commit bf772046cc
20 files changed
+4409 -2670

No files matched your search

+21 -19
View File
@@ -11,26 +11,26 @@ $loggedOut = isset($_GET['out']);
$curIp = client_ip();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$username = trim((string)($_POST['username'] ?? ''));
$password = (string)($_POST['password'] ?? '');
if ($username === '' || $password === '') {
$err = '请输入用户名和密码。';
} elseif (hp_login($username, $password)) {
// 正常登录成功:清零本 IP 风控计数(避免携带历史失败次数,防止管理员自误封)
risk_clear_for_ip($curIp);
header('Location: nav.php');
exit;
$username = trim((string) ($_POST['username'] ?? ''));
$password = (string) ($_POST['password'] ?? '');
if ($username === '' || $password === '') {
$err = '请输入用户名和密码。';
} elseif (hp_login($username, $password, (string) ($_POST['dev'] ?? ''))) {
// 正常登录成功:清零本 IP 风控计数(避免携带历史失败次数,防止管理员自误封)
risk_clear_for_ip($curIp);
header('Location: nav.php');
exit;
} else {
// 轻量防爆破延时(命中黑名单的 IP 在访问本页前即被 access_boot 拦截)
usleep(500000);
$risk = risk_login_fail($curIp);
if ($risk[1]) {
$err = '用户名或密码错误。';
// $err = '登录失败次数过多(本次累计 ' . $risk[0] . ' 次,达到阈值 ' . $risk[2] . ' 次),当前 IP 已被风控自动封禁,全站(含后台登录)访问均被拒绝。请稍后从未被封禁的网络进入后台「风控管理 → IP 黑名单」移除该规则解除,或联系站长处理。';
} else {
// 轻量防爆破延时(命中黑名单的 IP 在访问本页前即被 access_boot 拦截)
usleep(500000);
$risk = risk_login_fail($curIp);
if ($risk[1]) {
$err = '用户名或密码错误。';
// $err = '登录失败次数过多(本次累计 ' . $risk[0] . ' 次,达到阈值 ' . $risk[2] . ' 次),当前 IP 已被风控自动封禁,全站(含后台登录)访问均被拒绝。请稍后从未被封禁的网络进入后台「访问信息 → IP 黑名单」移除该规则解除,或联系站长处理。';
} else {
$err = '用户名或密码错误。';
}
$err = '用户名或密码错误。';
}
}
}
$site = setting_get('site_name', '知识导航站');
@@ -52,6 +52,7 @@ layout_head('后台登录');
<input type="text" id="username" name="username" required autofocus>
<label class="fl" for="password">密码</label>
<input type="password" id="password" name="password" required>
<input type="hidden" name="dev" id="devField" value="">
<div style="margin-top:16px">
<button type="submit" class="btn btn-primary" style="width:100%">登录</button>
</div>
@@ -61,4 +62,5 @@ layout_head('后台登录');
<?php layout_theme_fab(); ?>
<script src="../assets/js/common.js"></script>
</body>
</html>
</html>