From 612164abde3a9cda59a89e174866807938d4ff7d Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期二, 28 二月 2023 14:42:03 +0800
Subject: [PATCH] 优化文件下载出现的异常(I6DLNU)

---
 src/plugins/download.js |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/plugins/download.js b/src/plugins/download.js
index 41b2934..33d9a8d 100644
--- a/src/plugins/download.js
+++ b/src/plugins/download.js
@@ -15,9 +15,9 @@
       url: url,
       responseType: 'blob',
       headers: { 'Authorization': 'Bearer ' + getToken() }
-    }).then(async (res) => {
-      const isLogin = await blobValidate(res.data);
-      if (isLogin) {
+    }).then((res) => {
+      const isBlob = blobValidate(res.data);
+      if (isBlob) {
         const blob = new Blob([res.data])
         this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
       } else {
@@ -32,9 +32,9 @@
       url: url,
       responseType: 'blob',
       headers: { 'Authorization': 'Bearer ' + getToken() }
-    }).then(async (res) => {
-      const isLogin = await blobValidate(res.data);
-      if (isLogin) {
+    }).then((res) => {
+      const isBlob = blobValidate(res.data);
+      if (isBlob) {
         const blob = new Blob([res.data])
         this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
       } else {
@@ -49,9 +49,9 @@
       url: url,
       responseType: 'blob',
       headers: { 'Authorization': 'Bearer ' + getToken() }
-    }).then(async (res) => {
-      const isLogin = await blobValidate(res.data);
-      if (isLogin) {
+    }).then((res) => {
+      const isBlob = blobValidate(res.data);
+      if (isBlob) {
         const blob = new Blob([res.data], { type: 'application/zip' })
         this.saveAs(blob, name)
       } else {

--
Gitblit v1.9.3