修复下载按钮失效game
This commit is contained in:
parent
ec36a22fa4
commit
3ab5787c26
@ -202,12 +202,19 @@
|
|||||||
'X-Requested-With': 'XMLHttpRequest'
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error('网络响应失败');
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.code === 1) {
|
if (data.code === 1) {
|
||||||
const downloadsElement = document.getElementById('gameDownloads');
|
const downloadsElement = document.getElementById('gameDownloads');
|
||||||
let downloads = parseInt(downloadsElement.textContent);
|
if (downloadsElement) {
|
||||||
downloadsElement.textContent = downloads + 1;
|
let downloads = parseInt(downloadsElement.textContent);
|
||||||
|
downloadsElement.textContent = downloads + 1;
|
||||||
|
}
|
||||||
|
|
||||||
// 直接使用返回的URL
|
// 直接使用返回的URL
|
||||||
if (data.data && data.data.url) {
|
if (data.data && data.data.url) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user