把后端返回来的数据文本或者二进制流的数据,转换成字节,返回成一个新的blob对象,再去进行下载 代码示例 axios.get("xxx").then(res=>{ const blob = new Blob([res], { type: "application/msword;charset=utf-8" }); let url = window.URL.createObjectURL(blob); if (window.navigator.msSaveOrOpenBlob) { // 兼容IE10 navigat…