JS下载Excel

 const paramStr = "page=1&size=20";
  const actionUrl = "/export/XXX?" + paramStr;
  const exportForm = document.createElement('form');
  exportForm.style.display = "none";
  exportForm.setAttribute('action', actionUrl);
  exportForm.setAttribute('method', 'post');
  document.body.appendChild(exportForm);
  exportForm.submit();
  
  setTimeout(() => {
    document.body.removeChild(exportForm);
  }, 3000);
posted @ 2023-12-27 16:48  胡姐姐  阅读(43)  评论(0编辑  收藏  举报