From 27087cf06cc50699e2b89fff1060486cf0e84379 Mon Sep 17 00:00:00 2001
From: wjt <1797368093@qq.com>
Date: 星期三, 14 八月 2024 17:11:39 +0800
Subject: [PATCH] 批量下载图片

---
 src/utils/request.ts |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/utils/request.ts b/src/utils/request.ts
index fd457f9..b399f84 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -136,7 +136,10 @@
 export function download(url: string, params: any, filename: string, config: any) {
   downloadLoadingInstance = ElLoading.service({ text: "姝e湪涓嬭浇鏁版嵁锛岃绋嶅��", background: "rgba(0, 0, 0, 0.7)" });
   return service
-    .post(url, params, {
+    .get(url, { 
+      params,
+      responseType: "blob",
+    }, {
       transformRequest: [
         (params) => {
           return tansParams(params);
@@ -147,6 +150,7 @@
       ...config,
     })
     .then(async (data) => {
+      // console.log(data, 'data===')
       const isBlob = blobValidate(data);
       if (isBlob) {
         const blob = new Blob([data]);

--
Gitblit v1.9.1