A2C工单修复

This commit is contained in:
root
2026-07-03 20:12:20 +08:00
parent c3223f026e
commit 0f3eb53afe
21 changed files with 1561 additions and 172 deletions
@@ -7,11 +7,12 @@ namespace app\common\library\scrm\spider;
use app\common\library\scrm\AbstractScrmSpider;
use app\common\library\scrm\AntiBotConfigBuilder;
use app\common\library\scrm\UnifiedScrmData;
use app\common\service\SplitPageUrlResolver;
/**
* A2C 云控蜘蛛(Real Browser 打开分享页 + 拦截加密 API + UI 翻页)
*
* 业务域 user.a2c.chat 无需 cf_clearance;短链 yyk.ink 仍由浏览器 follow 跳转
* 业务域 user.a2c.chat 在 CF 挑战页启用 CapSolver 兜底;短链 yyk.ink 预解析为长链后直达业务页
*/
class A2cSpider extends AbstractScrmSpider
{
@@ -27,6 +28,9 @@ class A2cSpider extends AbstractScrmSpider
private string $password;
/** @var string HTTP 预解析落地 URL(供 antiBot landingUrlHint */
private string $landingUrlHint = '';
private UnifiedScrmData $unifiedData;
public function __construct(
@@ -39,6 +43,7 @@ class A2cSpider extends AbstractScrmSpider
$this->pageUrl = $pageUrl;
$this->account = $account;
$this->password = $password;
$this->landingUrlHint = SplitPageUrlResolver::resolveFinalUrl($pageUrl);
$this->unifiedData = new UnifiedScrmData();
}
@@ -53,7 +58,7 @@ class A2cSpider extends AbstractScrmSpider
'authActions' => [
['type' => 'wait', 'ms' => 2000],
],
'antiBot' => AntiBotConfigBuilder::build('a2c', $this->pageUrl),
'antiBot' => AntiBotConfigBuilder::build('a2c', $this->pageUrl, $this->landingUrlHint),
];
}
@@ -80,7 +80,7 @@ class HuojianSpider extends AbstractScrmSpider
protected function parseToUnifiedData($detailData, array $allListPagesData): UnifiedScrmData
{
$unifiedData = $this->unifiedData;
$unifiedData->todayNewCount = (int) ($allListPagesData[0]['data']['counterWorker']['newTodayFriend'] ?? 0) + (int) ($allListPagesData[0]['data']['counterWorker']['newRemovedTodayFriend'] ?? 0);
$unifiedData->todayNewCount = (int) ($allListPagesData[0]['data']['counterWorker']['newTodayFriend'] ?? 0);
$count = 0;
foreach ($allListPagesData as $pageRaw) {
$records = $pageRaw['data']['counterCsAccountVo'] ?? [];