验证pipe禁止未定义的字段
This commit is contained in:
@@ -8,6 +8,7 @@ async function bootstrap() {
|
||||
app.useGlobalPipes(new ValidationPipe({
|
||||
transform: true,
|
||||
whitelist: true,
|
||||
forbidNonWhitelisted: true,
|
||||
stopAtFirstError: true,
|
||||
exceptionFactory: (errors) => {
|
||||
const error = errors[0];
|
||||
|
||||
Reference in New Issue
Block a user