日志升级与缓存修复最终版
This commit is contained in:
Executable
+41
@@ -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]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user