const link = document.createElement('a'); link.href = '下载链接'; document.body.appendChild(link); link.click(); document.body.removeChild(link);