|
@@ -372,7 +372,7 @@ const uploadSingleImage = async (
|
|
|
imageObj.status = UPLOAD_STATUS.UPLOADING
|
|
imageObj.status = UPLOAD_STATUS.UPLOADING
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- const compressedFile = await compressImage(imageObj.file, 0.5)
|
|
|
|
|
|
|
+ const compressedFile = await compressImage(imageObj.file, 5*1024 * 1024)
|
|
|
const data = new FormData()
|
|
const data = new FormData()
|
|
|
data.set('file', compressedFile)
|
|
data.set('file', compressedFile)
|
|
|
data.set('type', category)
|
|
data.set('type', category)
|
|
@@ -700,7 +700,7 @@ const changeFile = async (
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// 压缩图片(EditImage保存的是PNG,可能很大)
|
|
// 压缩图片(EditImage保存的是PNG,可能很大)
|
|
|
- const compressedFile = await compressImage(editedFile)
|
|
|
|
|
|
|
+ const compressedFile = await compressImage(editedFile,5*1024 * 1024)
|
|
|
|
|
|
|
|
// 释放旧的预览URL(内存管理)
|
|
// 释放旧的预览URL(内存管理)
|
|
|
if (imageObj.url && imageObj.url.startsWith('blob:')) {
|
|
if (imageObj.url && imageObj.url.startsWith('blob:')) {
|