From c96612e8a63ecef9590be0f8b5199277ec94e5b9 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期三, 18 九月 2024 18:43:12 +0800
Subject: [PATCH] 云学习购买目录,修改bug

---
 assets/js/middleGround/api/file.js |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/assets/js/middleGround/api/file.js b/assets/js/middleGround/api/file.js
index 5edfbd4..4339689 100644
--- a/assets/js/middleGround/api/file.js
+++ b/assets/js/middleGround/api/file.js
@@ -36,10 +36,14 @@
   },
   //涓婁紶鏂囦欢
   upload(data) {
+    console.log(data)
     return request({
       url: "/file/api/ApiUpload",
       method: "post",
-      data
+      header: {
+        'content-type': data.contentType,
+      },
+      data: data.buffer,
     });
   },
 
@@ -71,15 +75,23 @@
   },
 
   // 鎵归噺涓嬭浇get
-  getDownloadFiles (params) {
+  getDownloadFiles(params) {
     return request({
       url: '/file/api/ApiGetDownloadFiles',
       method: 'GET',
       responseType: 'blob',
-      headers:{
-        'md5s':params
+      headers: {
+        'md5s': params
       }
     });
+  },
+  // 鍙戦�佷笅杞介偖浠�
+  sendFileWithEmail(data) {
+    return request({
+      url: '/file/api/ApiSendFileWithEmail',
+      method: 'post',
+      data
+    })
   }
 }
 

--
Gitblit v1.9.1