feat: 添加部分API限流规则
This commit is contained in:
@@ -10,7 +10,11 @@ export class SmsController {
|
||||
|
||||
@Post('send/login')
|
||||
@UseGuards(ThrottlerGuard)
|
||||
@Throttle({ sms_login: { limit: 10, ttl: 60000 } })
|
||||
@Throttle({
|
||||
'min': { limit: 3, ttl: 60 * 1000 },
|
||||
'hour': { limit: 10, ttl: 60 * 60 * 1000 },
|
||||
'day': { limit: 20, ttl: 24 * 60 * 60 * 1000 }
|
||||
})
|
||||
async sendLoginSms(@Body() dto: SendLoginSmsDto) {
|
||||
await this.smsService.sendSms(dto.phone, 'login');
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user