修复日志页面卡顿我呢提
This commit is contained in:
@@ -230,6 +230,14 @@ $ntVerifyOut = shell_exec($ntVerifyCmd);
|
||||
$ntVerifyJson = json_decode((string) $ntVerifyOut, true);
|
||||
reg_assert('f_check nt.txt 畸形行跳过且 fp 索引合法', ($ntVerifyJson['ok'] ?? false) === true, (string) $ntVerifyOut);
|
||||
|
||||
$riskCacheOut = shell_exec(escapeshellarg(PHP_BINARY) . ' ' . escapeshellarg($root . '/tools/verify_risk_cache.php') . ' 2>/dev/null');
|
||||
$riskCacheJson = json_decode((string) $riskCacheOut, true);
|
||||
reg_assert('二次风控 Session 缓存与 CORS', ($riskCacheJson['ok'] ?? false) === true, (string) $riskCacheOut);
|
||||
|
||||
$datalistHelperOut = shell_exec(escapeshellarg(PHP_BINARY) . ' ' . escapeshellarg($root . '/tools/verify_datalist_helper.php') . ' 2>/dev/null');
|
||||
$datalistHelperJson = json_decode((string) $datalistHelperOut, true);
|
||||
reg_assert('日志列表 VisitorLogListHelper', ($datalistHelperJson['ok'] ?? false) === true, (string) $datalistHelperOut);
|
||||
|
||||
// ── 12. ConfigLoader / 宝塔部署文件 ───────────────────────────
|
||||
echo "[12] ConfigLoader 与宝塔部署\n";
|
||||
require_once $root . '/config/ConfigLoader.php';
|
||||
@@ -322,6 +330,24 @@ if (defined('DB_NAME')) {
|
||||
if ($waitId) {
|
||||
$conn->query('DELETE FROM `visitor_logs` WHERE `id` = ' . (int) $waitId);
|
||||
}
|
||||
|
||||
$GLOBALS['__cloak_force_sync_log'] = true;
|
||||
$simLogId = @write_log_db(array_merge($sampleLogs, [
|
||||
'visit_md5_code' => 'reg_sim_' . substr(md5((string) microtime(true)), 0, 12),
|
||||
'is_simulation' => 1,
|
||||
'sim_source_log_id' => 99999,
|
||||
'reason' => VisitorSimulationRunner::tagReason('regression'),
|
||||
]));
|
||||
unset($GLOBALS['__cloak_force_sync_log']);
|
||||
reg_assert('模拟日志 is_simulation 写入', $simLogId !== null && (int) $simLogId > 0);
|
||||
if ($simLogId) {
|
||||
$chk = $conn->query('SELECT is_simulation, sim_source_log_id FROM visitor_logs WHERE id=' . (int) $simLogId);
|
||||
$simRow = $chk ? $chk->fetch_assoc() : null;
|
||||
reg_assert('模拟列 is_simulation=1', $simRow && (int) $simRow['is_simulation'] === 1);
|
||||
reg_assert('模拟列 sim_source_log_id', $simRow && (int) $simRow['sim_source_log_id'] === 99999);
|
||||
$conn->query('DELETE FROM visitor_logs WHERE id=' . (int) $simLogId);
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
}
|
||||
} else {
|
||||
@@ -335,6 +361,17 @@ CloakDebugPage::init();
|
||||
CloakDebugPage::stepAt(__LINE__, 'regression', 'info', 'ok');
|
||||
reg_assert('CloakDebugPage::stepAt 可调用', true);
|
||||
|
||||
// ── 11. 模拟测试组件 ─────────────────────────────────────────
|
||||
echo "[11] 模拟测试组件\n";
|
||||
require_once $root . '/lib/Cloak/VisitorSimulationRunner.php';
|
||||
reg_assert('FCheckHandler 已加载', class_exists('FCheckHandler', false));
|
||||
reg_assert('SimulationRouteResolver 已加载', class_exists('SimulationRouteResolver', false));
|
||||
reg_assert('VisitorSimulationRunner 已加载', class_exists('VisitorSimulationRunner', false));
|
||||
$tagged = VisitorSimulationRunner::tagReason('国家不符');
|
||||
reg_assert('VisitorSimulationRunner::tagReason 前缀', strpos($tagged, '[模拟测试]') === 0, $tagged);
|
||||
$badPrefill = VisitorSimulationRunner::prefillFromLog(0);
|
||||
reg_assert('prefillFromLog(0) 返回失败', empty($badPrefill['ok']));
|
||||
|
||||
// ── 汇总 ──────────────────────────────────────────────────────
|
||||
echo "\n=== 汇总 ===\n";
|
||||
echo "通过: {$passed} 失败: {$failed} 跳过: {$skipped}\n";
|
||||
|
||||
Reference in New Issue
Block a user