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; }