perf: 登录失败增加重试次数限制及冷却时间

This commit is contained in:
xiaojunnuo
2024-11-28 11:10:57 +08:00
parent 8002a56efc
commit 954b6df360
3 changed files with 103 additions and 2 deletions
@@ -24,6 +24,20 @@ export class LoginController extends BaseController {
return this.ok(token);
}
@Post('/loginBySms', { summary: Constants.per.guest })
public async loginBySms(
@Body(ALL)
body: any
) {
const token = await this.loginService.loginBySmsCode(body);
this.ctx.cookies.set('token', token.token, {
maxAge: 1000 * token.expire,
});
return this.ok(token);
}
@Post('/logout', { summary: Constants.per.authOnly })
public logout() {}
}