export function downloadKnowledage(parameter) {
  return axios({
    url: '/knowledage/download',
    method: 'GET',
    params: parameter,
    responseType: 'blob'
  })
}
 
添加 responseType: 'blob’解决以下乱码现象
 
 使用触发a标签下载文件
downloadKnowledage(data).then((res) => {
        let link = document.createElement("a");
        link.href = window.URL.createObjectURL(
          new Blob([res.data], {
            type: "application/octet-stream;charset=UTF-8",
          })
        );
        link.setAttribute("download", file_name);
        document.body.appendChild(link);
        link.click();
        link.remove();
      });
                


![[2025]医院健康陪诊系统(源码+定制+服务)](https://i-blog.csdnimg.cn/direct/3c50e9ae67344a8ebceace28e7913ab4.png)















