Skip to content

Commit dd36bbc

Browse files
committed
Merge branch 'master' of https://gitee.com/yudaocode/yudao-ui-admin-vue3 into dev
2 parents e2fe047 + 939ceb3 commit dd36bbc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/UploadFile/src/useUpload.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ export const useUpload = () => {
1717
// 1.2 获取文件预签名地址
1818
const presignedInfo = await FileApi.getFilePresignedUrl(fileName)
1919
// 1.3 上传文件(不能使用 ElUpload 的 ajaxUpload 方法的原因:其使用的是 FormData 上传,Minio 不支持)
20-
return axios.put(presignedInfo.uploadUrl, options.file).then(() => {
20+
return axios.put(presignedInfo.uploadUrl, options.file, {
21+
headers: {
22+
'Content-Type': options.file.type,
23+
}
24+
}).then(() => {
2125
// 1.4. 记录文件信息到后端(异步)
2226
createFile(presignedInfo, fileName, options.file)
2327
// 通知成功,数据格式保持与后端上传的返回结果一致

0 commit comments

Comments
 (0)