lex 1 jaar geleden
bovenliggende
commit
5ed187965d
1 gewijzigde bestanden met toevoegingen van 12 en 2 verwijderingen
  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 => {