添加whatshub工单
This commit is contained in:
Regular → Executable
+10
-3
@@ -107,6 +107,11 @@ abstract class AbstractScrmSpider
|
||||
if ($detailApi) { $apiUrlsToIntercept[] = $detailApi; }
|
||||
if ($countApi) { $apiUrlsToIntercept[] = $countApi; }
|
||||
// var_dump($apiUrlsToIntercept);
|
||||
// dump([
|
||||
// 'pageUrl' => $config['pageUrl'],
|
||||
// 'apiUrls' => $apiUrlsToIntercept,
|
||||
// 'authActions' => $config['authActions']
|
||||
// ]);
|
||||
// 【阶段一】:初始化并首屏拦截
|
||||
$initResult = $this->requestNode('/api/auth-and-intercept', [
|
||||
'pageUrl' => $config['pageUrl'],
|
||||
@@ -120,7 +125,8 @@ abstract class AbstractScrmSpider
|
||||
|
||||
$interceptedApis = $initResult['interceptedApis'];
|
||||
$cookies = $initResult['cookies'];
|
||||
// dd($interceptedApis);
|
||||
$finalPageUrl = $initResult['finalPageUrl'] ?? $config['pageUrl'];
|
||||
|
||||
// 必须拦截到 List 接口,否则无法继续
|
||||
if (!isset($interceptedApis[$listApi])) {
|
||||
throw new Exception("致命错误:未能拦截到必须的列表接口 [{$listApi}]");
|
||||
@@ -133,7 +139,7 @@ abstract class AbstractScrmSpider
|
||||
// dd($countData);
|
||||
$listApiNode = $interceptedApis[$listApi];
|
||||
$allListPagesData = [$listApiNode['data']]; // 初始化列表容器,装入第一页数据
|
||||
|
||||
// dd($allListPagesData);exit;
|
||||
$totalPages = $this->extractListTotalPages($listApiNode['data'], $countData);
|
||||
|
||||
$mode = $config['paginationMode'] ?? self::MODE_FETCH;
|
||||
@@ -163,7 +169,7 @@ abstract class AbstractScrmSpider
|
||||
if ($pResult['success']) $allListPagesData[] = $pResult['data'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 策略 2:强制 UI 点击
|
||||
elseif ($mode === self::MODE_UI) {
|
||||
$uiConfig = $this->getUiPaginationConfig();
|
||||
@@ -176,6 +182,7 @@ abstract class AbstractScrmSpider
|
||||
$uiResult = $this->requestNode('/api/ui-pagination', [
|
||||
'apiUrl' => $listApi,
|
||||
'pageUrl' => $config['pageUrl'],
|
||||
'finalPageUrl' => $finalPageUrl,
|
||||
'nextBtnSelector' => $uiConfig['nextBtnSelector'],
|
||||
'waitMs' => $uiConfig['waitMs'] ?? 2000,
|
||||
'clicksToPerform' => $clicksToPerform,
|
||||
|
||||
Reference in New Issue
Block a user