Skip to content

NestJS使用ValidationPipe使用正则表达式校验会偶发校验问题 #3

@su37josephxia

Description

@su37josephxia

再现方法

  app.useGlobalPipes(new ValidationPipe({
    forbidUnknownValues: false
  }))
  @Matches(regMobileCN, { message: '请输入正确手机号' })
  readonly phoneNumber: string;

同一输入内容,使用@matches会出现有时候校验通过有时候校验不通过的问题

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions