We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e2fe047 + 939ceb3 commit dd36bbcCopy full SHA for dd36bbc
src/components/UploadFile/src/useUpload.ts
@@ -17,7 +17,11 @@ export const useUpload = () => {
17
// 1.2 获取文件预签名地址
18
const presignedInfo = await FileApi.getFilePresignedUrl(fileName)
19
// 1.3 上传文件(不能使用 ElUpload 的 ajaxUpload 方法的原因:其使用的是 FormData 上传,Minio 不支持)
20
- return axios.put(presignedInfo.uploadUrl, options.file).then(() => {
+ return axios.put(presignedInfo.uploadUrl, options.file, {
21
+ headers: {
22
+ 'Content-Type': options.file.type,
23
+ }
24
+ }).then(() => {
25
// 1.4. 记录文件信息到后端(异步)
26
createFile(presignedInfo, fileName, options.file)
27
// 通知成功,数据格式保持与后端上传的返回结果一致
0 commit comments