1. When doing a pdf export function, the card owner can be downloaded, but the downloaded pdf file is blank. Using the postman test to download the background pdf file can be opened normally and has content
.2. Download code:
downLoadResume(){
axios.post("url",{
responseType: "arraybuffer"
}).then((res)=>{
console.log(res);
if(res.status == 200){
let blob = new Blob([res.data], {
type: `application/pdf;charset-UTF-8`//wordmsword,pdfpdf
});
let objectUrl = URL.createObjectURL(blob);
console.log(objectUrl);
let downEle = document.createElement("a");
let fname = `download`; //
downEle.href = objectUrl;
downEle.setAttribute("download", fname);
document.body.appendChild(downEle);
downEle.click();
}
// fileDownload(res.data,"resume.pdf")
}).catch((err)=>{
console.log(err);
})
}