From 457fb0a0671ae4d7695d15b23ca6f1577443964a Mon Sep 17 00:00:00 2001 From: unknown <18119604035@163.com> Date: Sun, 30 Jul 2023 15:47:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AF=A6=E6=83=85=E8=AF=BE?= =?UTF-8?q?=E4=BB=B6=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/index.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/pages/course/index.tsx b/src/pages/course/index.tsx index a20404f..1ab7800 100644 --- a/src/pages/course/index.tsx +++ b/src/pages/course/index.tsx @@ -118,15 +118,14 @@ const CoursePage = () => { const downLoadFile = (cid: number, id: number) => { vod.downloadAttachment(cid, id).then((res: any) => { if (isWechat()) { - const input = document.createElement("input"); + Toast.show("请点击右上角···浏览器打开下载"); + var input = document.createElement("input"); + input.value = res.data.download_url; document.body.appendChild(input); - input.setAttribute("value", res.data.download_url); input.select(); - if (document.execCommand("copy")) { - document.execCommand("copy"); - Toast.show("请点击右上角···浏览器打开下载"); - } + document.execCommand("Copy"); document.body.removeChild(input); + window.open(res.data.download_url); } else { window.open(res.data.download_url); }