From f3af185d0ac725839dd77834c64f88efeb659bb7 Mon Sep 17 00:00:00 2001 From: yuping <82253452@qq.com> Date: Thu, 23 Mar 2023 14:33:59 +0800 Subject: [PATCH] --fix bug --- src/components/common/QrCode.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/common/QrCode.vue b/src/components/common/QrCode.vue index 1bf006a9..513a885c 100644 --- a/src/components/common/QrCode.vue +++ b/src/components/common/QrCode.vue @@ -86,12 +86,10 @@ function download() { document.querySelector(".downloadCode"), { useCORS: true } ).then((canvas) => { - let filename = `${new Date().getTime()}.png`; - let imageUrl = canvas.toDataURL("image/png"); let a = document.createElement("a"); a.style.display = "none"; - a.download = filename; - a.href = imageUrl; + a.download = `${new Date().getTime()}.png`; + a.href = canvas.toDataURL("image/png"); document.body.appendChild(a); a.click(); });