风险系数判断修复

This commit is contained in:
root
2026-06-14 18:30:06 +08:00
parent 235bf939b8
commit eb2724e3de
143 changed files with 68315 additions and 73 deletions
+47 -6
View File
@@ -34,16 +34,19 @@ if (!empty($_REQUEST["action"]) && $_REQUEST["action"] == "delUrlArgs") {
}
// 确定当前配置上下文(供表单回显用)
$isNewConfigDraft = false;
if (!empty($_REQUEST["name"])) {
$check_name = trim($_REQUEST["name"]);
$config_name = str_replace(".php", "", $check_name);
$config_file = "check_config/" . $config_name . "_config.php";
if (!file_exists($config_file)) {
copy("check_config/index_config.php", $config_file);
// 新建或未保存的配置:仅回显 index 模板,不在此写盘
$isNewConfigDraft = true;
$config_file = "check_config/index_config.php";
}
} else {
$check_name = "index";
$config_file = "check_config/index_config.php";
$config_file = "check_config/index_config.php";
}
include($config_file);
@@ -773,7 +776,7 @@ $_d = function($name, $default) { return defined($name) ? constant($name) : $def
<div class="card shadow-sm" style="border-radius:8px;overflow:hidden;">
<div class="card-header-custom">
<h5>编辑配置:<?php echo htmlspecialchars($check_name); ?></h5>
<h5><?php echo $isNewConfigDraft ? '新增配置' : '编辑配置'; ?><?php echo htmlspecialchars($check_name); ?><?php if ($isNewConfigDraft): ?> <span class="badge badge-warning" style="font-size:.75rem;vertical-align:middle;">未保存</span><?php endif; ?></h5>
<div>
<?php if (empty($_SESSION["check_result"]) || $_SESSION["check_result"] != "true"): ?>
<a href="<?php echo $current_name; ?>?action=setuvi&res=true&name=<?php echo $check_name; ?>" class="btn btn-sm btn-outline-success mr-1">设置当前浏览器为真实访客</a>
@@ -1068,14 +1071,52 @@ $_d = function($name, $default) { return defined($name) ? constant($name) : $def
<div id="sec-advanced" style="display:none;">
<table class="table table-sm mb-0">
<tr>
<td class="form-label-cell">指纹风险系数(0=关闭,推荐50最大90</td>
<td class="form-val-cell"><input type="number" name="risk_number" class="form-control form-control-sm" value="<?php echo CLOAK_RISK_NUMBER; ?>" style="width:100px;" min="0" max="90"></td>
<td class="form-label-cell">指纹风险系数(0=关闭,最大90</td>
<td class="form-val-cell">
<input type="number" name="risk_number" class="form-control form-control-sm" value="<?php echo CLOAK_RISK_NUMBER; ?>" style="width:100px;" min="0" max="90">
<div class="text-muted mt-2" style="font-size:.78rem;line-height:1.55;">
数值越高,拦截越严格。访客风险分达到或超过此值时跳转安全页,低于则进入真实页。
设为 <strong>0</strong> 表示关闭二次风控。
</div>
<details class="mt-2" style="font-size:.78rem;line-height:1.55;">
<summary style="cursor:pointer;color:#0c5460;font-weight:600;">推荐设置(与下方「加强判断」配合)</summary>
<div class="text-muted mt-2">
<p class="mb-2">请根据「加强判断」开关选择对应数值,两种模式<strong>不宜使用同一分数</strong>。</p>
<table class="table table-sm table-bordered mb-2" style="font-size:.76rem;background:#fff;">
<thead class="thead-light">
<tr><th>加强判断</th><th>建议分数</th><th>说明</th></tr>
</thead>
<tbody>
<tr>
<td><strong>OFF</strong></td>
<td><strong>68</strong></td>
<td>默认推荐,兼顾流量与防护,误拦较少</td>
</tr>
<tr>
<td><strong>ON</strong></td>
<td><strong>52</strong></td>
<td>识别更严,适合需要更高防护的场景</td>
</tr>
</tbody>
</table>
<p class="mb-1"><strong>微调:</strong></p>
<ul class="mb-0 pl-3">
<li>真实用户被误拦 → 分数 <strong>+3 ~ +5</strong></li>
<li>可疑访问漏过 → 分数 <strong>3 ~ 5</strong></li>
<li>可在「访问日志 → 显示更多 → 判定详情」查看每条记录的风险分与拦截原因</li>
</ul>
</div>
</details>
</td>
</tr>
<tr>
<td class="form-label-cell">加强判断</td>
<td class="form-val-cell">
<?php echo onoff_radio('risk_enhanced', $_d('CLOAK_RISK_ENHANCED', 'OFF')); ?>
<div class="text-muted mt-1" style="font-size:.78rem;">开启后将额外采集 Canvas / WebGL / WebGPU / 字体等深度指纹,识别更精细;老旧设备或弱网环境下可能导致二次风控无法完成。仅在需要更高精度时开启。</div>
<div class="text-muted mt-1" style="font-size:.78rem;line-height:1.55;">
开启后识别更精细,可拦截更多自动化访问;老旧设备或弱网环境下可能受影响。<br>
建议配合上方风险系数:OFF 用 <strong>68</strong>ON 用 <strong>52</strong>。
</div>
</td>
</tr>
<tr>