From beb51d727825d23a9d204849bc0f3d8906cc629d Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 10 Oct 2024 10:35:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF=E3=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BA=8B=E4=BB=B6=E5=9B=A0=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E6=9D=BF=E6=88=96=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E5=91=BD=E5=90=8D=E5=AF=BC=E8=87=B4=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=96=87=E4=BB=B6=E5=90=8E=E7=BC=80=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20#12198?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/utils/imgUtils.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/core-frontend/src/utils/imgUtils.ts b/core/core-frontend/src/utils/imgUtils.ts index 07f56e94ec..21d9cba60b 100644 --- a/core/core-frontend/src/utils/imgUtils.ts +++ b/core/core-frontend/src/utils/imgUtils.ts @@ -81,12 +81,9 @@ export function download2AppTemplate(downloadType, canvasDom, name, attachParams export function downloadCanvas2(type, canvasDom, name, callBack?) { toPng(canvasDom) .then(dataUrl => { - const a = document.createElement('a') - a.setAttribute('download', name) - a.href = dataUrl if (type === 'img') { const a = document.createElement('a') - a.setAttribute('download', name) + a.setAttribute('download', name + '.png') a.href = dataUrl document.body.appendChild(a) a.click()