feat: 后端也添加了写了一半的人机验证模块
This commit is contained in:
16
apps/backend/src/captcha/dto/get-captcha.dto.ts
Normal file
16
apps/backend/src/captcha/dto/get-captcha.dto.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { IsEnum, IsOptional, IsUUID } from "class-validator";
|
||||
|
||||
export enum CaptchaContext {
|
||||
SEND_SMS = 'send_sms',
|
||||
PASSKEY = 'passkey',
|
||||
}
|
||||
|
||||
export class GetCaptchaDto {
|
||||
|
||||
@IsEnum(CaptchaContext, { message: '无效的context' })
|
||||
context: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsUUID('4', { message: 'userId不合法' })
|
||||
userId?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user