<script>
function download(url, fileName) {
const el = document.createElement('a');
el.style.display = 'none';
el.setAttribute('target', '_blank');
fileName && el.setAttribute('download', fileName);
el.href = url;
document.body.appendChild(el);
el.click();
document.body.removeChild(el);
}
</script>
url:下载的文件路径
fileName:下载保存文件名