Przeglądaj źródła

修改最大图片大小

zengjun 2 tygodni temu
rodzic
commit
61091ff0e3
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/views/returned/register/index.vue

+ 2 - 2
src/views/returned/register/index.vue

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