42 lines
1007 B
PHP
Executable File
42 lines
1007 B
PHP
Executable File
<?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]);
|
|
}
|
|
}
|