fix: 支持新版 ChatGPT 登录验证码邮件匹配

This commit is contained in:
Ryan Liu
2026-04-24 18:06:13 +08:00
parent 9c1c0bc076
commit 70f3ffb266
13 changed files with 95 additions and 4 deletions
+3
View File
@@ -174,6 +174,9 @@ function extractVerificationCode(text) {
const matchCn = text.match(/(?:代码为|验证码[^0-9]*?)[\s:]*(\d{6})/);
if (matchCn) return matchCn[1];
const matchOpenAiLogin = text.match(/(?:chatgpt\s+log-?in\s+code|enter\s+this\s+code)[^0-9]{0,24}(\d{6})/i);
if (matchOpenAiLogin) return matchOpenAiLogin[1];
// Pattern 2: English format "code is 370794" or "code: 370794"
const matchEn = text.match(/code[:\s]+is[:\s]+(\d{6})|code[:\s]+(\d{6})/i);
if (matchEn) return matchEn[1] || matchEn[2];