日志升级与缓存修复最终版

This commit is contained in:
root
2026-06-16 04:58:56 +08:00
parent bcb9f293a6
commit 6b3b99b0f1
61 changed files with 2405 additions and 333 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
require_once __DIR__ . '/VisitorVisitContext.php';
/**
* 二次风控 wait / f_check 与 visit 日志绑定(与 VisitorVisitContext 对齐)
*/
class RiskSecondarySession
{
const KEY_WAIT_LOG = 'cloak_risk_wait_log_id';
/**
* @param int|null $logId
*/
public static function markWaitLog($logId)
{
$logId = (int) $logId;
if ($logId > 0) {
$_SESSION[self::KEY_WAIT_LOG] = $logId;
VisitorVisitContext::bindLogId($logId);
}
}
/**
* f_check 已 finalize 后,FpPageRenderer 不再重复写库。
*/
public static function shouldSkipFpPageLog()
{
if (VisitorVisitContext::isFinalized()) {
return true;
}
if (VisitorVisitContext::currentLogId() > 0 && (string) ($_SESSION['visit_to_3'] ?? '') === '3') {
return true;
}
return false;
}
public static function clear()
{
unset($_SESSION[self::KEY_WAIT_LOG]);
}
}