export function downloadByBlob(url, name) {
const image = new Image()
image.setAttribute('crossOrigin', 'anonymous')
image.src = url
image.onload = () => {
const canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
const ctx = canvas.getContext('2d')
ctx.drawImage(image, 0, 0, image.width, image.height)
canvas.toBlob((blob) => {
const url1 = URL.createObjectURL(blob)
const eleLink = document.createElement('a')
eleLink.download = name
eleLink.href = url1
eleLink.click()
eleLink.remove()
URL.revokeObjectURL(url)
})
}
}
downloadByBlob(val.prescriptionSignedUrl, '处方')