记录一下自己工作中用到的功能
import axios from 'axios'
const BLOB_URL:string = 'xxxxxx'
axios
.get({
BLOB_URL,
{
responseType: 'blob'
}
})
.then((res: object) => {
const file = new File([res.data], 'xxxx.jpg')
const formData = new FormData()
formData.append('file', file)
// your upload action
// ......
// ......
})