feat: 实现短信模块
This commit is contained in:
13
apps/backend/src/auth/dto/sms-login.dto.ts
Normal file
13
apps/backend/src/auth/dto/sms-login.dto.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { IsPhoneNumber, Matches } from "class-validator";
|
||||
|
||||
export class SmsLoginDto {
|
||||
@IsPhoneNumber('CN', {
|
||||
message: '请输入有效的中国大陆手机号',
|
||||
})
|
||||
phone: string;
|
||||
|
||||
@Matches(/^\d{6}$/, {
|
||||
message: '验证码必须是6位数字',
|
||||
})
|
||||
code: string;
|
||||
}
|
||||
Reference in New Issue
Block a user