|
@@ -128,15 +128,15 @@ export async function downloadBlob(fetchFunc, fileName) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-function toDataURL(url) {
|
|
|
- return fetch(url)
|
|
|
- .then(response => {
|
|
|
- return response.blob();
|
|
|
- })
|
|
|
- .then(blob => {
|
|
|
- return URL.createObjectURL(blob);
|
|
|
- });
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
*
|
|
@@ -154,14 +154,15 @@ export async function downloadFileURL(url, name) {
|
|
|
.split("?")[0];
|
|
|
link.setAttribute("download", fileName);
|
|
|
|
|
|
-
|
|
|
- if ([".txt"].some(v => fileName.endsWith(v))) {
|
|
|
-
|
|
|
-
|
|
|
- link.href = await toDataURL(url);
|
|
|
- } else {
|
|
|
- link.href = url;
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ link.href = url;
|
|
|
document.body.appendChild(link);
|
|
|
link.click();
|
|
|
document.body.removeChild(link);
|