liyongli 12 小時之前
父節點
當前提交
30d6503912
共有 3 個文件被更改,包括 19 次插入13 次删除
  1. 13 7
      saveOSSAGitte.js
  2. 3 3
      src/view/fenghui/en.js
  3. 3 3
      src/view/fenghui/zh.js

+ 13 - 7
saveOSSAGitte.js

@@ -59,7 +59,6 @@ class saveOssGitte {
     console.log("oss文件清除---完成");
     try {
       await this.getFiles(path.resolve(__dirname, "./" + this.localDir));
-      console.log("数据上传oss---完成");
     } catch (err) {
       console.log("数据上传oss---失败");
     }
@@ -90,12 +89,19 @@ 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);
+      console.log("数据上传oss---完成");
     } catch (e) {
       console.error("未成功上传:", filePath.join("\\"));
       console.log("err--->", e);

+ 3 - 3
src/view/fenghui/en.js

@@ -211,9 +211,9 @@ export default {
         { "text": "Jordan", "value": "约旦" },
         { "text": "Viet Nam", "value": "越南" },
         { "text": "The Chinese mainland", "value": "中国大陆" },
-        { "text": "Hong Kong, China", "value": "香港" },
-        { "text": "Macao, China", "value": "澳门" },
-        { "text": "Taiwan, China", "value": "台湾" },
+        { "text": "Hong Kong, China", "value": "中国香港" },
+        { "text": "Macao, China", "value": "中国澳门" },
+        { "text": "Taiwan, China", "value": "中国台湾" },
 
         { "text": "Africa", "value": "非洲", "disabled": true },
         { "text": "Algeria", "value": "阿尔及利亚" },

+ 3 - 3
src/view/fenghui/zh.js

@@ -210,9 +210,9 @@ export default {
         { "text": "约旦", "value": "约旦" },
         { "text": "越南", "value": "越南" },
         { "text": "中国大陆", "value": "中国大陆" },
-        { "text": "香港", "value": "香港" },
-        { "text": "澳门", "value": "澳门" },
-        { "text": "台湾", "value": "台湾" },
+        { "text": "中国香港", "value": "中国香港" },
+        { "text": "中国澳门", "value": "中国澳门" },
+        { "text": "中国台湾", "value": "中国台湾" },
 
         { "text": "非洲", "value": "非洲", "disabled": true },
         { "text": "阿尔及利亚", "value": "阿尔及利亚" },