feat: 将图片上传大小限制从 8MB 提升到 20MB
This commit is contained in:
parent
691c626e3f
commit
ff359fe03b
@ -85,8 +85,8 @@ async function optimizeImage(buffer: Buffer, mimeType: string): Promise<Buffer>
|
|||||||
const FileSchema = z.object({
|
const FileSchema = z.object({
|
||||||
file: z
|
file: z
|
||||||
.instanceof(Blob)
|
.instanceof(Blob)
|
||||||
.refine((file) => file.size <= 8 * 1024 * 1024, {
|
.refine((file) => file.size <= 20 * 1024 * 1024, {
|
||||||
message: "File size should be less than 8MB",
|
message: "File size should be less than 20MB",
|
||||||
})
|
})
|
||||||
// Update the file type based on the kind of files you want to accept
|
// 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), {
|
.refine((file) => ["image/jpeg", "image/png", "image/webp"].includes(file.type), {
|
||||||
|
|||||||
@ -866,8 +866,8 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file.size > 8 * 1024 * 1024) {
|
if (file.size > 20 * 1024 * 1024) {
|
||||||
toast.error('图片大小不能超过 8MB');
|
toast.error('图片大小不能超过 20MB');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -271,9 +271,9 @@ export function ImageNode({ node, isSelected }: ImageNodeProps) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证文件大小 (8MB)
|
// 验证文件大小 (20MB)
|
||||||
if (file.size > 8 * 1024 * 1024) {
|
if (file.size > 20 * 1024 * 1024) {
|
||||||
toast.error('图片大小不能超过 8MB');
|
toast.error('图片大小不能超过 20MB');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user