feat: 将图片上传大小限制从 8MB 提升到 20MB

This commit is contained in:
Your Name 2026-02-03 10:23:34 +08:00
parent 691c626e3f
commit ff359fe03b
3 changed files with 7 additions and 7 deletions

View File

@ -85,8 +85,8 @@ async function optimizeImage(buffer: Buffer, mimeType: string): Promise<Buffer>
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), {

View File

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

View File

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