perf: 增加找回密码的验证码可重试次数 @nicheng-he (#496)

2.找回密码邮件方式增加长度到6位
3.开启自主找回密码放置更合适的位置
This commit is contained in:
ahe
2025-08-09 16:41:57 +08:00
committed by GitHub
parent 2a9a513d85
commit fe03f9942b
5 changed files with 60 additions and 18 deletions
@@ -28,6 +28,8 @@ export class LoginController extends BaseController {
if(!sysSettings.selfServicePasswordRetrievalEnabled) {
throw new CommonException('暂未开启自助找回');
}
// 找回密码的验证码允许错误次数
const errorNum = 5;
if(body.type === 'email') {
this.codeService.checkEmailCode({
@@ -35,6 +37,7 @@ export class LoginController extends BaseController {
email: body.input,
randomStr: body.randomStr,
validateCode: body.validateCode,
errorNum,
throwError: true,
});
} else if(body.type === 'mobile') {
@@ -44,6 +47,7 @@ export class LoginController extends BaseController {
randomStr: body.randomStr,
phoneCode: body.phoneCode,
smsCode: body.validateCode,
errorNum,
throwError: true,
});
} else {