Files
thebet365/apps/api/src/domains/identity/auth.dto.ts
Mars 312c3c5816 feat(player): 注册账号、登录双模式与移动端性能优化
注册必填 7-32 位账号,手机号区号/本地号分存;登录默认账号模式并支持切换手机号登录;Player i18n 拆包与赛事接口优化。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 10:56:51 +08:00

75 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { IsString, MinLength, IsOptional, IsNumber } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
export class LoginDto {
@ApiProperty()
@IsString()
username!: string;
@ApiProperty()
@IsString()
@MinLength(1)
password!: string;
@ApiProperty({ required: false, description: '国家区号,不含 +,如 86' })
@IsOptional()
@IsString()
countryCode?: string;
}
export class RegisterDto {
@ApiProperty({ description: '登录账号7-32 位字母数字' })
@IsString()
@MinLength(7)
username!: string;
@ApiProperty({ description: '本地手机号,不含国家区号' })
@IsString()
phone!: string;
@ApiProperty({ description: '国家区号,不含 +,如 86' })
@IsString()
countryCode!: string;
@ApiProperty()
@IsString()
@MinLength(8)
password!: string;
@ApiProperty({ description: '短信验证码' })
@IsString()
smsCode!: string;
@ApiProperty({ description: '发送验证码返回的 sessionId' })
@IsString()
sessionId!: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
inviteCode?: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
locale?: string;
}
export class ChangePasswordDto {
@ApiProperty()
@IsString()
oldPassword!: string;
@ApiProperty()
@IsString()
@MinLength(8)
newPassword!: string;
}
export class GenerateInviteDto {
@ApiProperty({ required: false, description: 'Decimal cashback rate, e.g. 0.01 = 1%. Admin only.' })
@IsOptional()
@IsNumber()
cashbackRate?: number;
}