feat: 实现短信模块

This commit is contained in:
2025-12-17 23:01:13 +08:00
parent 54acad1671
commit 2ef3507cea
10 changed files with 286 additions and 13 deletions

View 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;
}