Browse Source

上传多张图片>1M的时候才开启压缩

shaogen1995 1 năm trước cách đây
mục cha
commit
835f20fb2b
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/components/ZupTypes/index.tsx

+ 2 - 2
src/components/ZupTypes/index.tsx

@@ -191,9 +191,9 @@ function ZupTypes(
 
         fd.append("file", filesInfo);
 
-        if(fileOneType==='img'){
+        if (fileOneType === "img" && filesInfo.size > 1 * 1024 * 1024) {
           // 开启压缩图片
-          fd.append("isCompress", 'true');
+          fd.append("isCompress", "true");
         }
 
         e.target.value = "";