|
@@ -89,18 +89,18 @@ class saveOssGitte {
|
|
let dir = filePath[0].split("\\");
|
|
let dir = filePath[0].split("\\");
|
|
dir = dir.reverse()[0] + "/";
|
|
dir = dir.reverse()[0] + "/";
|
|
if (dir === this.localDir) dir = "";
|
|
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---完成");
|
|
console.log("数据上传oss---完成");
|
|
} catch (e) {
|
|
} catch (e) {
|
|
console.error("未成功上传:", filePath.join("\\"));
|
|
console.error("未成功上传:", filePath.join("\\"));
|