2025-09-10 08:04:28 +08:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
|
import { IsOptional, IsNumber, IsString } from 'class-validator';
|
|
|
|
|
|
|
|
|
|
export class LoginConfigDto {
|
|
|
|
|
@ApiProperty({ description: '是否启用验证码', required: false })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsNumber()
|
|
|
|
|
isCaptcha?: number;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ description: '是否启用站点验证码', required: false })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsNumber()
|
|
|
|
|
isSiteCaptcha?: number;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ description: '登录背景图', required: false })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
bg?: string;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ description: '站点登录背景图', required: false })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
siteBg?: string;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ description: '登录方式配置', required: false })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
loginMethods?: {
|
|
|
|
|
username?: boolean;
|
|
|
|
|
email?: boolean;
|
|
|
|
|
mobile?: boolean;
|
|
|
|
|
wechat?: boolean;
|
|
|
|
|
qq?: boolean;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ description: '密码策略配置', required: false })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
passwordPolicy?: {
|
|
|
|
|
minLength?: number;
|
|
|
|
|
requireSpecialChar?: boolean;
|
|
|
|
|
requireNumber?: boolean;
|
|
|
|
|
requireUppercase?: boolean;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ description: '登录失败限制', required: false })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
loginLimit?: {
|
|
|
|
|
maxAttempts?: number;
|
|
|
|
|
lockoutDuration?: number;
|
|
|
|
|
lockoutType?: string;
|
|
|
|
|
};
|
2025-09-13 08:35:59 +08:00
|
|
|
|
|
|
|
|
// PHP 特有字段
|
|
|
|
|
@ApiProperty({ description: '是否启用授权注册', required: false })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
isAuthRegister?: boolean;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ description: '是否强制获取用户信息', required: false })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
isForceAccessUserInfo?: boolean;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ description: '是否绑定手机号', required: false })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
isBindMobile?: boolean;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ description: '是否显示协议', required: false })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
agreementShow?: boolean;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ description: '描述信息', required: false })
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
desc?: string;
|
2025-09-10 08:04:28 +08:00
|
|
|
}
|