liyongli 13 godzin temu
rodzic
commit
a180d1db5d
1 zmienionych plików z 11 dodań i 11 usunięć
  1. 11 11
      saveOSSAGitte.js

+ 11 - 11
saveOSSAGitte.js

@@ -89,18 +89,18 @@ class saveOssGitte {
       let dir = filePath[0].split("\\");
       dir = dir.reverse()[0] + "/";
       if (dir === this.localDir) dir = "";
-      // await this.client.put(
-      //   this.baseOssDir + dir + filePath[1],
-      //   path.normalize(filePath.join("\\"))
-      //   // 自定义headers
-      //   //,{headers}
-      // );
+      await this.client.put(
+        this.baseOssDir + dir + filePath[1],
+        path.normalize(filePath.join("\\"))
+        // 自定义headers
+        //,{headers}
+      );
 
-      const result = await client.multipartUpload(filePath[1], this.baseOssDir + dir + filePath[1], {
-        partSize: 1 * 1024 * 1024, // 分片大小1MB
-        progress: (p) => console.log(`进度:${Math.round(p * 100)}%`)
-      });
-      console.log('分片上传完成:', result);
+      // const result = await client.multipartUpload(filePath[1], this.baseOssDir + dir + filePath[1], {
+      //   partSize: 1 * 1024 * 1024, // 分片大小1MB
+      //   progress: (p) => console.log(`进度:${Math.round(p * 100)}%`)
+      // });
+      // console.log('分片上传完成:', result);
       console.log("数据上传oss---完成");
     } catch (e) {
       console.error("未成功上传:", filePath.join("\\"));