lrf402788946 4 سال پیش
والد
کامیت
1ef38d329f
1فایلهای تغییر یافته به همراه23 افزوده شده و 23 حذف شده
  1. 23 23
      app/controller/files.js

+ 23 - 23
app/controller/files.js

@@ -61,30 +61,30 @@ class FilesController extends Controller {
       await sendToWormhole(stream);
       throw err;
     }
-    // 判断是不是作业的图片,是=>统一转换
-    const arr = fileName.split('.');
-    if (arr.length > 0 && filePath.includes('task')) {
-      const suffix = arr.find(
-        f =>
-          f.includes('jpg') ||
-          f.includes('jpeg') ||
-          f.includes('bmp') ||
-          f.includes('gif') ||
-          f.includes('png')
+    // // 判断是不是作业的图片,是=>统一转换
+    // const arr = fileName.split('.');
+    // if (arr.length > 0 && filePath.includes('task')) {
+    //   const suffix = arr.find(
+    //     f =>
+    //       f.includes('jpg') ||
+    //       f.includes('jpeg') ||
+    //       f.includes('bmp') ||
+    //       f.includes('gif') ||
+    //       f.includes('png')
 
-      );
-      if (suffix) {
-        await sharp(`${filePath}${fileName}`)
-          .resize(1000)
-          .toFile(`${filePath}${name}_.jpg`)
-          .then(data => {
-            // 将转换之前的文件删除
-            fs.unlinkSync(`${filePath}${fileName}`);
-            fileName = `${name}_.jpg`;
-            name = `${name}_`;
-          });
-      }
-    }
+    //   );
+    //   if (suffix) {
+    //     await sharp(`${filePath}${fileName}`)
+    //       .resize(1000)
+    //       .toFile(`${filePath}${name}_.jpg`)
+    //       .then(data => {
+    //         // 将转换之前的文件删除
+    //         fs.unlinkSync(`${filePath}${fileName}`);
+    //         fileName = `${name}_.jpg`;
+    //         name = `${name}_`;
+    //       });
+    //   }
+    // }
     return { filePath, fileName, id: name };
   }