pc网页版软测宝
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
keysass_portal/src/util/pdfDownLoad.js

18 lines
418 B

8 months ago
function downPdf(val, fileName) {
fetch(val)
.then(respose => {
return respose.blob()
})
.then(blob => {
console.log(val)
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
const name = fileName ? fileName : val.substr(val.lastIndexOf('/') + 1, val.length)
a.href = url
a.download = name
a.click()
8 months ago
})
}
8 months ago
export default downPdf