接口:
axios({
url: api.path_3 + '/getFile',
method: 'post',
responseType: 'blob' //注意这个一定要加
})
接口返回数据处理:
download().then((res)=>{ //res为返回的数据
let blob = new Blob([res], {type: "application/msword"}); // type有一下很多类型
let objectUrl = URL.createObjectURL(blob);
window.location.href = objectUrl;
})