|
|
|
@ -33,23 +33,19 @@ if (location.hostname !== "localhost")
|
|
|
|
|
if (!res.ok) return;
|
|
|
|
|
res.text().then(serverVersion =>
|
|
|
|
|
{
|
|
|
|
|
if (res.status)
|
|
|
|
|
if (serverVersion)
|
|
|
|
|
{
|
|
|
|
|
if (version !== serverVersion)
|
|
|
|
|
{
|
|
|
|
|
document.body.style.cssText = `
|
|
|
|
|
text-align: center;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-size: 30px;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
`;
|
|
|
|
|
document.body.textContent = "发现新版本,升级中!";
|
|
|
|
|
location.reload();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (res.status && serverVersion && version !== serverVersion)
|
|
|
|
|
{
|
|
|
|
|
document.body.style.cssText = `
|
|
|
|
|
text-align: center;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-size: 30px;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
`;
|
|
|
|
|
document.body.textContent = "发现新版本,升级中!";
|
|
|
|
|
location.reload();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|