修复下载功能

This commit is contained in:
2025-05-20 10:34:02 +08:00
parent 7542d76d39
commit 16d2fe4520
13 changed files with 2249 additions and 69 deletions
+2 -2
View File
@@ -28,7 +28,7 @@
<div class="main-menu">
<div class="container">
<div class="main-menu__logo">
<a href="index.html"><img src="__IMAGES__/logo.png" width="186" alt="Logo"></a>
<a href="index.html"><img src="__IMAGES__/logo1.png" width="186" alt="Logo"></a>
</div>
<div class="main-menu__nav">
<ul class="main-menu__list">
@@ -70,7 +70,7 @@
<div class="sticky-nav" style="display: none;">
<div class="container">
<div class="sticky-nav__logo">
<a href="index.html"><img src="__IMAGES__/logo.png" width="150" alt="Logo"></a>
<a href="index.html"><img src="__IMAGES__/logo1.png" width="150" alt="Logo"></a>
</div>
<div class="sticky-nav__menu">
<ul>
+9 -15
View File
@@ -203,6 +203,11 @@
margin: 30px 0;
}
.program-navigation a{
color: #333;
text-decoration: none;
}
.prev-program,
.next-program {
max-width: 45%;
@@ -464,22 +469,11 @@
})
.then(response => response.json())
.then(data => {
if (data.code === 1) {
const downloadsElement = document.getElementById('programDownloads');
let downloads = parseInt(downloadsElement.textContent);
downloadsElement.textContent = downloads + 1;
// 获取当前域名
const domain = window.location.origin;
// 拼接完整的下载地址
if (data.data && data.data.fileurl) {
const downloadUrl = domain + data.data.fileurl;
window.location.href = downloadUrl;
} else {
alert('下载地址不存在');
}
if (data.code === 1 && data.data && data.data.fileurl) {
const downloadUrl = window.location.origin + data.data.fileurl;
window.location.href = downloadUrl;
} else {
alert('下载失败:' + data.msg);
alert('下载地址不存在');
}
})
.catch(error => {