You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCAD/utils/log.html

47 lines
1.4 KiB

<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>更新日志</title>
<script>
fetch("ver.json").then(res => {
if (!res.ok) return;
res.json().then(v => {
if (res.status)
if (v)
{
let oldVer = sessionStorage.getItem("ver");
sessionStorage.setItem("ver", v);
if (oldVer && oldVer != v)
{
document.body.textContent = "发现新版本,升级中!";
location.reload();
}
}
})
});
</script>
</head>
<body>
<div id="content"></div>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script>
var jsonRequestUrl = 'log.json';
var decoder = $('<div />');
var decodedText = '';
$.getJSON(jsonRequestUrl, function foo(result) {
$.each(result, function (index, value) {
decoder.html(value.data.body_html);
decodedText += decoder.text();
});
$('#content').append(decodedText);
});</script>
</body>
</html>