From 76e7ed8f250bc0ee658ef4d8c672d61a987bb613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Tue, 24 Sep 2024 19:14:52 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E6=96=87=E4=BB=B6=E7=9B=B4=E4=BC=A0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sheep/components/s-uploader/choose-and-upload-file.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sheep/components/s-uploader/choose-and-upload-file.js b/sheep/components/s-uploader/choose-and-upload-file.js index 64175e4c..a92e0ace 100644 --- a/sheep/components/s-uploader/choose-and-upload-file.js +++ b/sheep/components/s-uploader/choose-and-upload-file.js @@ -107,7 +107,7 @@ function normalizeChooseAndUploadFileRes(res, fileType) { item.name = item.path.substring(item.path.lastIndexOf('/') + 1); } if (fileType) { - item.type = fileType; + item.fileType = fileType; } item.cloudPath = Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.')); }); @@ -217,7 +217,7 @@ async function uploadFiles(choosePromise, { onChooseFile, onUploadProgress }) { url: presignedInfo.uploadUrl, // 预签名的上传 URL method: 'PUT', // 使用 PUT 方法 header: { - 'Content-Type': file.type + '/' + file.name.substring(file.name.lastIndexOf('.') + 1), // 设置内容类型 + 'Content-Type': file.fileType + '/' + file.name.substring(file.name.lastIndexOf('.') + 1), // 设置内容类型 }, data: fileBuffer, // 文件的路径,适用于小程序 success: (res) => {