feat: 添加密码登陆接口限流

This commit is contained in:
2025-12-19 20:00:52 +08:00
parent 45d0c87adb
commit 4803145f86

View File

@@ -44,6 +44,10 @@ export class AuthController {
} }
@Post('login/password') @Post('login/password')
@UseGuards(ThrottlerGuard)
@Throttle({ 'min': { limit: 10, ttl: 60 * 1000 } })
@Throttle({ 'hour': { limit: 20, ttl: 60 * 60 * 1000 } })
@Throttle({ 'day': { limit: 50, ttl: 24 * 60 * 60 * 1000 } })
async loginByPassword( async loginByPassword(
@Body() loginDto: LoginByPasswordDto, @Body() loginDto: LoginByPasswordDto,
@Res({ passthrough: true }) res: Response, @Res({ passthrough: true }) res: Response,