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({
|
||||
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), {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user