From ac4c7d9c3f10c86538620ef60d73354013e2ef5a Mon Sep 17 00:00:00 2001 From: ray <1416431931@qq.com> Date: Wed, 6 May 2026 14:52:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=AF=A6=E6=83=85=E5=81=9A?= =?UTF-8?q?=E5=BB=B6=E8=BF=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aliyun-sync/aliyun-aps-sync/src/sync.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aliyun-sync/aliyun-aps-sync/src/sync.js b/aliyun-sync/aliyun-aps-sync/src/sync.js index 10d029f..d383816 100644 --- a/aliyun-sync/aliyun-aps-sync/src/sync.js +++ b/aliyun-sync/aliyun-aps-sync/src/sync.js @@ -317,6 +317,10 @@ function subtractDays(dateValue, days) { return next; } +function randomIntBetween(min, max) { + return Math.floor(Math.random() * (max - min + 1)) + min; +} + function parseDbDateTime(value) { const normalized = String(value || '').trim(); if (!normalized) { @@ -655,6 +659,9 @@ async function syncCustomerDetails(page) { await runtimeCheckpoint(`客户详情 ${index + 1}/${allAccountIds.length}`); const accountId = allAccountIds[index]; console.log(`[客户详情] ${index + 1}/${allAccountIds.length} accountId=${accountId}`); + const pauseMs = randomIntBetween(1000, 3000); + console.log(`[客户详情] 随机等待 ${pauseMs}ms 后继续`); + await sleep(pauseMs); // 先跳 about:blank 再跳详情URL(强制 SPA 完整重新加载) await page.goto('about:blank');