fix: accept scheme-less drainage URLs
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
import { IsBoundedJsonObject } from './bounded-json-object.validator';
|
||||
import { DRAINAGE_TARGET_ERROR, DRAINAGE_TARGET_PATTERN } from './drainage-target';
|
||||
|
||||
export class ClientCertificationSubmissionDto {
|
||||
@IsString() @MinLength(1) @MaxLength(200) companyName!: string;
|
||||
@@ -105,8 +106,8 @@ export class ClientDrainageInfoDto {
|
||||
@IsString()
|
||||
@MinLength(1)
|
||||
@MaxLength(2048)
|
||||
@Matches(/^(?:https?:\/\/\S+|(?:\+?86[\s-]?)?1(?:[\s-]?\d){10}|(?:\+?86[\s-]?)?(?:\(?0\d{2,3}\)?[\s-]?)?\d{7,8}(?:[\s-]?(?:转|ext\.?)?[\s-]?\d{1,6})?)$/i, {
|
||||
message: '引流信息必须是 http/https URL、手机号码或固定电话号码',
|
||||
@Matches(DRAINAGE_TARGET_PATTERN, {
|
||||
message: DRAINAGE_TARGET_ERROR,
|
||||
})
|
||||
url!: string;
|
||||
@IsOptional() @IsString() @MaxLength(1000) remark?: string;
|
||||
|
||||
Reference in New Issue
Block a user