lex 1 年之前
父節點
當前提交
5ed187965d
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      src/helpers/oss-file-upload.ts

+ 12 - 2
src/helpers/oss-file-upload.ts

@@ -117,7 +117,12 @@ export const onFileUpload = ({
         }
       })
       .then((res: any) => {
-        file.url = 'https://' + res.Location;
+        // file.url = 'https://' + res.Location;
+        if (res.Location?.indexOf('http') >= 0) {
+          file.url = res.Location;
+        } else {
+          file.url = 'https://' + res.Location;
+        }
         onFinish();
       })
       .catch(error => {
@@ -191,7 +196,12 @@ export const onOnlyFileUpload = async (action: string, params: any) => {
       })
       .then((res: any) => {
         // file.url = 'https://' + res.Location;
-        file = 'https://' + res.Location;
+        // file = 'https://' + res.Location;
+        if (res.Location?.indexOf('http') >= 0) {
+          file = res.Location;
+        } else {
+          file = 'https://' + res.Location;
+        }
         // onFinish();
       })
       .catch(error => {