课程详情课件下载

This commit is contained in:
unknown 2023-07-30 15:47:31 +08:00
parent dbab0780fe
commit 457fb0a067

View File

@ -118,15 +118,14 @@ const CoursePage = () => {
const downLoadFile = (cid: number, id: number) => { const downLoadFile = (cid: number, id: number) => {
vod.downloadAttachment(cid, id).then((res: any) => { vod.downloadAttachment(cid, id).then((res: any) => {
if (isWechat()) { if (isWechat()) {
const input = document.createElement("input"); Toast.show("请点击右上角···浏览器打开下载");
var input = document.createElement("input");
input.value = res.data.download_url;
document.body.appendChild(input); document.body.appendChild(input);
input.setAttribute("value", res.data.download_url);
input.select(); input.select();
if (document.execCommand("copy")) { document.execCommand("Copy");
document.execCommand("copy");
Toast.show("请点击右上角···浏览器打开下载");
}
document.body.removeChild(input); document.body.removeChild(input);
window.open(res.data.download_url);
} else { } else {
window.open(res.data.download_url); window.open(res.data.download_url);
} }