1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| let nowVersion = ""
function getNewVerson(){ fetch("/indexmapversion").then(response => { if (!response.ok) { throw new Error('网络请求失败'); } return response.json(); }).then(data => { console.log(data); if(!nowVersion){ nowVersion = data.version }else{ if(nowVersion != data.version){ window.location.reload() } } }).catch(error => { console.error('网络请求失败:', error); }); }
setInterval(getNewVerson,60000)
|