From 241089d0f5af54d713b6b6f01e1c9eb800c5ba47 Mon Sep 17 00:00:00 2001 From: wkj <278599135@.com> Date: Wed, 4 Dec 2024 12:27:13 +0800 Subject: [PATCH] =?UTF-8?q?ServerConfiguration=20=E5=AF=B9koaBody=E5=A3=B0?= =?UTF-8?q?=E6=98=8E=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/types/Configuration.d.ts | 11 ++++++++++- src/types/Configuration.ts | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/types/Configuration.d.ts b/lib/types/Configuration.d.ts index 44e4b43..dbbc48d 100644 --- a/lib/types/Configuration.d.ts +++ b/lib/types/Configuration.d.ts @@ -35,7 +35,16 @@ export type ServerConfiguration = { }; internalExceptionMask?: string; koaBody?: { - maxFileSize?: number; + multipart?: boolean; + formidable?: { + maxFileSize?: number; + maxFields?: number; + maxFieldsSize?: number; + uploadDir?: string; + keepExtensions?: boolean; + hashAlgorithm?: string; + multiples?: boolean; + }; }; }; /** diff --git a/src/types/Configuration.ts b/src/types/Configuration.ts index d0f12c1..62ac952 100644 --- a/src/types/Configuration.ts +++ b/src/types/Configuration.ts @@ -37,7 +37,16 @@ export type ServerConfiguration = { }, internalExceptionMask?: string; koaBody?: { - maxFileSize?: number; + multipart?: boolean; //框架默认开启 用于处理multipart/form-data类型的请求,这种类型通常用于上传文件。 + formidable?: { + maxFileSize?: number; + maxFields?: number; + maxFieldsSize?: number; + uploadDir?: string; + keepExtensions?: boolean; + hashAlgorithm?: string; + multiples?: boolean; + } }; };