format + lint

This commit is contained in:
2025-06-14 14:12:18 +08:00
parent e777afc433
commit 90a67b681e
69 changed files with 1756 additions and 1583 deletions

View File

@@ -1,19 +1,19 @@
import { IsEnum, IsString, Length, ValidateIf } from "class-validator";
import { IsEnum, IsString, Length, ValidateIf } from 'class-validator';
export class SendVerificationCodeDto {
@IsEnum(['phone', 'email'], { message: '请求类型错误' })
targetType: 'phone' | 'email';
@IsEnum(['phone', 'email'], { message: '请求类型错误' })
targetType: 'phone' | 'email';
@IsEnum(['login'], { message: '请求类型错误' })
type: 'login'
@IsEnum(['login'], { message: '请求类型错误' })
type: 'login';
@ValidateIf(o => o.targetType === 'phone')
@IsString({ message: '手机号必须输入' })
@Length(11, 11, { message: '手机号异常' })// 中国大陆11位数字
phone?: string;
@ValidateIf((o) => o.targetType === 'phone')
@IsString({ message: '手机号必须输入' })
@Length(11, 11, { message: '手机号异常' }) // 中国大陆11位数字
phone?: string;
@ValidateIf(o => o.targetType === 'email')
@IsString({ message: '邮箱必须输入' })
@Length(6, 254, { message: '邮箱异常' })// RFC 5321
email?: string;
}
@ValidateIf((o) => o.targetType === 'email')
@IsString({ message: '邮箱必须输入' })
@Length(6, 254, { message: '邮箱异常' }) // RFC 5321
email?: string;
}