Fix delayed combined signup profile detection

This commit is contained in:
EmptyDust
2026-05-02 11:44:36 +08:00
parent 2bfa277aa1
commit 0a17d95f44
2 changed files with 212 additions and 1 deletions
+15 -1
View File
@@ -2573,7 +2573,8 @@ async function fillVerificationCode(step, payload) {
await waitForLoginVerificationPageReady();
}
const combinedSignupProfilePage = step === 4 && isCombinedSignupVerificationProfilePage();
const combinedSignupProfilePage = step === 4
&& await waitForCombinedSignupVerificationProfilePage();
if (combinedSignupProfilePage) {
if (!signupProfile || !signupProfile.firstName || !signupProfile.lastName) {
throw new Error('当前注册验证码页面要求同时填写资料,但未提供姓名或生日数据。');
@@ -3404,6 +3405,19 @@ function isCombinedSignupVerificationProfilePage() {
);
}
async function waitForCombinedSignupVerificationProfilePage(timeout = 2500) {
const start = Date.now();
while (Date.now() - start < timeout) {
if (isCombinedSignupVerificationProfilePage()) {
return true;
}
await sleep(100);
}
return isCombinedSignupVerificationProfilePage();
}
async function step5_fillNameBirthday(payload) {
const { firstName, lastName, age, year, month, day, prefillOnly = false } = payload;
if (!firstName || !lastName) throw new Error('未提供姓名数据。');