fix(signup): restart phone signup on step 3 phone-exists errors

Treat phone-number-already-exists messages on the signup password page as the same restartable step-3 failure path used for phone/password mismatches.

Also adds a regression test covering the Chinese phone-exists error so the flow stops immediately instead of retrying the password submit loop.
This commit is contained in:
yigedludan8
2026-05-07 21:00:17 +08:00
parent f6fa19a44f
commit da02aa62cf
2 changed files with 92 additions and 3 deletions
+3 -3
View File
@@ -2493,7 +2493,7 @@ const SIGNUP_PHONE_PASSWORD_MISMATCH_ERROR_PREFIX = 'SIGNUP_PHONE_PASSWORD_MISMA
const AUTH_MAX_CHECK_ATTEMPTS_ERROR_PREFIX = 'AUTH_MAX_CHECK_ATTEMPTS::';
const STEP8_EMAIL_IN_USE_ERROR_PREFIX = 'STEP8_EMAIL_IN_USE::';
const SIGNUP_EMAIL_EXISTS_PATTERN = /与此电子邮件地址相关联的帐户已存在|account\s+associated\s+with\s+this\s+email\s+address\s+already\s+exists|email\s+address.*already\s+exists/i;
const SIGNUP_PHONE_PASSWORD_MISMATCH_PATTERN = /incorrect\s+phone\s+number\s+or\s+password|phone\s+number\s+or\s+password/i;
const SIGNUP_PHONE_PASSWORD_MISMATCH_PATTERN = /incorrect\s+phone\s+number\s+or\s+password|phone\s+number\s+or\s+password|与此(?:电话|手机)号码相关联的帐户已存在|account\s+associated\s+with\s+this\s+phone\s+number\s+already\s+exists/i;
const authPageRecovery = self.MultiPageAuthPageRecovery?.createAuthPageRecovery?.({
detailPattern: AUTH_TIMEOUT_ERROR_DETAIL_PATTERN,
@@ -2552,9 +2552,9 @@ function createSignupUserAlreadyExistsError() {
function createSignupPhonePasswordMismatchError(detailText = '') {
const detail = String(detailText || '').replace(/\s+/g, ' ').trim();
const suffix = detail ? `页面提示:${detail}` : '页面提示手机号或密码不正确。';
const suffix = detail ? `页面提示:${detail}` : '页面提示注册手机号不可继续使用,需重新开始当前轮。';
return new Error(
`${SIGNUP_PHONE_PASSWORD_MISMATCH_ERROR_PREFIX}步骤 3:检测到注册手机号或密码不正确,需要重新开始当前轮。${suffix}`
`${SIGNUP_PHONE_PASSWORD_MISMATCH_ERROR_PREFIX}步骤 3:检测到注册手机号异常,需要重新开始当前轮。${suffix}`
);
}