From ff359fe03b03d4eac9c649dc76ef9a3a2b650277 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 3 Feb 2026 10:23:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B0=86=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=A4=A7=E5=B0=8F=E9=99=90=E5=88=B6=E4=BB=8E=208MB=20?= =?UTF-8?q?=E6=8F=90=E5=8D=87=E5=88=B0=2020MB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/(chat)/api/files/upload/route.ts | 4 ++-- components/canvas/CanvasChatPanel.tsx | 4 ++-- components/canvas/nodes/ImageNode.tsx | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/(chat)/api/files/upload/route.ts b/app/(chat)/api/files/upload/route.ts index 87dc422..f1020d4 100644 --- a/app/(chat)/api/files/upload/route.ts +++ b/app/(chat)/api/files/upload/route.ts @@ -85,8 +85,8 @@ async function optimizeImage(buffer: Buffer, mimeType: string): Promise const FileSchema = z.object({ file: z .instanceof(Blob) - .refine((file) => file.size <= 8 * 1024 * 1024, { - message: "File size should be less than 8MB", + .refine((file) => file.size <= 20 * 1024 * 1024, { + message: "File size should be less than 20MB", }) // Update the file type based on the kind of files you want to accept .refine((file) => ["image/jpeg", "image/png", "image/webp"].includes(file.type), { diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx index f65f940..aa523aa 100644 --- a/components/canvas/CanvasChatPanel.tsx +++ b/components/canvas/CanvasChatPanel.tsx @@ -866,8 +866,8 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF continue; } - if (file.size > 8 * 1024 * 1024) { - toast.error('图片大小不能超过 8MB'); + if (file.size > 20 * 1024 * 1024) { + toast.error('图片大小不能超过 20MB'); continue; } diff --git a/components/canvas/nodes/ImageNode.tsx b/components/canvas/nodes/ImageNode.tsx index 4d2f416..501f1fe 100644 --- a/components/canvas/nodes/ImageNode.tsx +++ b/components/canvas/nodes/ImageNode.tsx @@ -271,9 +271,9 @@ export function ImageNode({ node, isSelected }: ImageNodeProps) { return; } - // 验证文件大小 (8MB) - if (file.size > 8 * 1024 * 1024) { - toast.error('图片大小不能超过 8MB'); + // 验证文件大小 (20MB) + if (file.size > 20 * 1024 * 1024) { + toast.error('图片大小不能超过 20MB'); return; }