From 117bf43c253b1ffbd5a2c32d016a04f83bc8c5a9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 6 Sep 2026 02:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BA=AB=E4=BB=BD=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E8=BE=93=E9=94=99=E7=9F=AD=E4=BF=A1=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E6=97=B6=E6=98=BE=E7=A4=BA"=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E4=B8=8D=E6=AD=A3=E7=A1=AE"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CODE_INVALID 这个reason同时被独立密码校验和短信验证码校验两个不相关 接口复用,错误文案只写了前者的措辞,在身份验证页答非所问。改成对两 种场景都准确的通用措辞。 第十一轮最小粒度测试 Ch10-11 发现。 Co-Authored-By: Claude Sonnet 5 --- src/lib/im-api.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib/im-api.js b/src/lib/im-api.js index 9908ff09..215ba245 100644 --- a/src/lib/im-api.js +++ b/src/lib/im-api.js @@ -76,10 +76,16 @@ const REASON_MESSAGES = { YOUTH_MODE_RESTRICTED: '青少年模式下无法使用此功能', RISK_CONFIRMATION_REQUIRED: '需要先完成安全确认', RISK_ACTION_BLOCKED: '该操作已被安全策略拦截', - // 独立密码校验的两个 reason(对接文档 809 行有写),青少年模式关闭/开启走的都是这条接口。 - // 原来没收录,报错时直接透传后端英文原文——PIN 输错显示 "code invalid",连续错误锁定后 - // 显示 "too many attempts",且不告诉用户要等多久能重试。 - CODE_INVALID: '独立密码不正确', + // CODE_INVALID is shared by two unrelated verify endpoints -- independent-password PIN check + // (青少年模式关闭/开启走的这条接口,对接文档 809 行) *and* the plain SMS verification-code + // verify endpoints (/auth/verification-codes/{id}/verify, /security/challenges/{id}/verify -- + // confirmed live: entering a wrong SMS code on the "忘记独立密码?" identity-check screen also + // gets back reason=CODE_INVALID). This table only keys off the reason string with no per-call-site + // override, so a message written for just one of the two ("独立密码不正确") showed up verbatim on + // the *other* endpoint's screen, where there's no "独立密码" concept in view at all -- confusing, + // wrong-sounding copy for a real, correctly-rejected wrong code. Kept generic enough to be accurate + // for both rather than wrong in either. + CODE_INVALID: '验证码或独立密码不正确', TOO_MANY_ATTEMPTS: details => details && details.retry_after_seconds ? `连续输错次数过多,请 ${details.retry_after_seconds} 秒后重试` : '连续输错次数过多,请稍后重试'