请求头需要加上
responseType: ‘blob’,
{
responseType: 'blob',
url: url,
method: 'get',
}
接到返回值后
.then((data) => {
const blob = new Blob([data],{
type:'application/pdf'
})
let url = window.URL.createObjectURL(blob);
window.open(url,"_blank")
});