返回的二进制流格式
<span class="update" @click="lookRecord">点击下载</span>
lookRecord() {
integrateRecordsr(this.realAccount).then((res) => { // 调接口拿取二进制流
if (res.size == 0) { // 如果返回是空的
this.$message({
message: "暂无催收记录",
type: "warning",
});
} else { // 返回不为空
var url = window.URL.createObjectURL(res);
var a = document.createElement("a");
a.href = url;
a.download = this.realAccount + ".xlsx"; // 下载后的文件名称
a.click();
}
});
},