fix(account-panel): drop the email code from password login - #170
Merged
huyanxius merged 1 commit intoAug 7, 2026
Merged
Conversation
1024XEngineer#156 已对齐的口径是验证码只保留给注册、免密登录与重设密码,1024XEngineer#149 合入的后端 /auth/login 也已经不再接收它。 收窄 login 的入参类型,密码模式跳过验证码校验、不再渲染验证码输入框与发送按钮,提交时只发邮箱和密码。 密码登录现在填账号密码即可完成,与后端接受的请求体一致。
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
前端密码登录路径去掉邮箱验证码,与 #149 已合入的后端
/auth/login对齐。Closes #169
Why
#156 讨论定下的口径是密码登录不再需要验证码,验证码只保留给注册、免密登录与重设密码。后端已在 #149 落地,
LoginRequest现在只有email与password。前端没跟上,而且症状不是"多发一个字段被后端忽略"这么轻。
validate()里的验证码格式校验对三种模式一视同仁,所以在密码登录页签填对邮箱和密码也提交不了,用户必须先走一次邮件往返,去拿一个后端根本不会校验的验证码。按 #156 的描述,换设备或清理浏览器数据之后重新登录就会撞上这条路径。Change Description
5 个文件,+41 −46。
entities/user/index.ts:login()入参类型去掉codefeatures/account-panel/index.tsx:密码模式跳过验证码校验、不再渲染验证码输入框与发送按钮、提交载荷去掉code、模式说明文案改写免密登录与注册两条路径的验证码行为完全不动。
Implementation Approach
mode !== 'password',一处管校验、一处管渲染,不引入新的 stateUserApis['login']去掉code之后tsc会把所有还在传code的调用点报出来,其中features/auth-session/index.test.tsx不在 issue 声明的范围里——它不是夹带,是类型收窄的编译强制连带,不改则 typecheck 与 build 都不过codestate 与 60 秒冷却逻辑原样保留,免密登录和注册仍在用Screenshots
密码登录页签,改动前后:
改动前多出「验证码」输入框与「发送验证码」按钮,说明文案是「使用密码和邮箱验证码确认身份。」;改动后只剩邮箱与密码两项,文案改为「用邮箱和密码直接登录。」
Testing
本地跑了
frontend-ci.yml的全部五步:npm run format:check— 通过,85 个文件npm run lint— 通过npm run typecheck— 通过npm run test— 通过,24 个文件 146 个用例npm run build— 通过另外用一个干净上下文的子代理做了独立验收。它自己重跑了这五步,并做了变异测试:把
code加回提交载荷、把验证码 UI 改成无条件渲染、把validate()的 mode 条件去掉、把login()类型改回要求code,四处都能让对应检查变红,确认这些测试挡得住回归。文案那条验收标准最初没有测试守护,是它指出来的,已补上断言并验证过能红。Follow-ups
SendCodePurpose的reset_password目前面板不产生,等 feat: 补齐找回密码接口 #154 落地后接入Related