Angular post请求,获取文件流方式,

正常请求参数,在请求post请求内容中放入

{responseType: ResponseContentType.Blob}

 

将获取的内容转化为url,windows.open(url)去下载

let blob = new Blob([ret], {type: 'application/zip'});
let objectUrl = URL.createObjectURL(blob);
window.open(objectUrl);

你可能感兴趣的:(附件下载)