export const uploadFile = (url:string,formData:any)=>{
return axios.post(
`${BaseUrl}/${url}`,
formData,
{
headers: {
"Content-Type": "multipart/form-data",
'Authorization': `${getToken()}`,
},
})
.then((res:any)=>{
return res.data
})
.catch(err=>{
return err
})
}
需要 "Content-Type": "multipart/form-data",的属性为上述这种 不然无法进行文件流输出