You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>烟雨江南客户端下载</title> <style> * { padding: 0; margin: 0; } .main { background: url('http://image.gyyxcdn.cn/upload/wd/p/wallpaper/2018bz6_1920.jpg') no-repeat; background-size: 100% 100%; width: 100vw; height: 100vh; box-sizing: border-box; display: flex; align-items: center; justify-content: flex-end; padding-right: 140px; } .btn { border: solid 1px #ddd; padding: 60px 80px; cursor: pointer; border-radius: 16px; color: #fff; font-size: 30px; background: linear-gradient(to bottom, #000000, #ffffff); } </style> </head> <body> <div class="main"> <div class="btn" onclick="download()">下载烟雨江南客户端</div> </div> </body> <script> const download = () => { fetch( 'https://lz.qaiu.top/json/parser?url=https://www.123pan.com/s/PK2tVv-1RxsA.html', ) .then(res => res.json()) .then(res => { if (res.code == 200) { let a = document.createElement('a') //创建一个a标签元素 a.style.display = 'none' //设置元素不可见 a.href = res.data //设置下载地址 document.body.appendChild(a) //加入 a.click() //触发点击,下载 document.body.removeChild(a) / 释放 } }) .catch(err => console.log(err)) } </script> </html>
|