let imgUrl = 'http://118.178.44.182:9080/hzzutil/mdfiles/' + e + '.jpg';
fetch(imgUrl).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
document.getElementById('downBtn')['href'] = URL.createObjectURL(blob);
});
<a id="downBtn" href="" download>下载</a>
网友评论