修复下载按钮失效game

This commit is contained in:
李志强 2025-05-26 16:01:02 +08:00
parent ec36a22fa4
commit 3ab5787c26

View File

@ -202,12 +202,19 @@
'X-Requested-With': 'XMLHttpRequest'
}
})
.then(response => response.json())
.then(response => {
if (!response.ok) {
throw new Error('网络响应失败');
}
return response.json();
})
.then(data => {
if (data.code === 1) {
const downloadsElement = document.getElementById('gameDownloads');
let downloads = parseInt(downloadsElement.textContent);
downloadsElement.textContent = downloads + 1;
if (downloadsElement) {
let downloads = parseInt(downloadsElement.textContent);
downloadsElement.textContent = downloads + 1;
}
// 直接使用返回的URL
if (data.data && data.data.url) {