导出多个文件

const iframe = document.createElement("iframe");
         iframe.style.display = "none"; // 防止影响页面
         iframe.style.height = 0; // 防止影响页面
         iframe.src = requestUrl;
         document.body.appendChild(iframe); // 这一行必须,iframe挂在到dom树上才会发请求
         // 5分钟之后删除(onload方法对于下载链接不起作用,就先抠脚一下吧)
         setTimeout(()=>{
             iframe.remove();
         }, 5 * 60 * 1000);

 

posted @ 2022-02-18 17:51  薛柏梁  阅读(16)  评论(0编辑  收藏  举报