<!DOCTYPE html>
|
<html lang="en">
|
<head>
|
<meta charset="utf-8" />
|
<meta name="renderer" content="webkit">
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="theme-color" content="#000000" />
|
<link rel="shortcut icon" href="#">
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
<title></title>
|
<script>
|
let _href = window.location.href.split('#')[0]
|
let l_version = localStorage.getItem(_href + 'version')
|
let _ctime = parseInt(new Date().getTime() / 1000)
|
let _time = ''
|
|
if (l_version) {
|
let vers = l_version.split('-')
|
l_version = vers[0]
|
_time = +vers[1]
|
}
|
|
if (_time && _ctime - _time < 180) {
|
let meta1 = document.createElement('meta')
|
let meta2 = document.createElement('meta')
|
let meta3 = document.createElement('meta')
|
let meta4 = document.createElement('meta')
|
meta1.content = '0'
|
meta1.httpEquiv = 'Expires'
|
meta2.content = 'no-cache'
|
meta2.httpEquiv = 'Pragma'
|
meta3.content = 'no-cache'
|
meta3.httpEquiv = 'Cache-Control'
|
meta4.content = 'no-cache'
|
meta4.httpEquiv = 'Cache'
|
document.getElementsByTagName('head')[0].appendChild(meta1)
|
document.getElementsByTagName('head')[0].appendChild(meta2)
|
document.getElementsByTagName('head')[0].appendChild(meta3)
|
document.getElementsByTagName('head')[0].appendChild(meta4)
|
} else {
|
fetch('./manifest.json', { cache: 'no-cache'})
|
.then(response => response.json())
|
.then(res => {
|
if (res && res.mk_version) {
|
let version = res.mk_version
|
let nocache = false
|
|
if (l_version && version !== l_version) {
|
nocache = true
|
localStorage.setItem(_href + 'version', version + '-' + _ctime)
|
} else if (!l_version) {
|
localStorage.setItem(_href + 'version', version + '-' + (_ctime - 360))
|
}
|
|
if (nocache) {
|
window.location.reload()
|
}
|
}
|
})
|
}
|
|
window.mkInfo = function(value, color = '') {
|
console.info(value, color)
|
}
|
</script>
|
</head>
|
<body>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<div id="root"></div>
|
<script>
|
if ('ActiveXObject' in window) {
|
window.onload = function() {
|
document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">您的浏览器<span style="color: #ff4d4f">不受支持</span></div>'
|
}
|
}
|
</script>
|
</body>
|
</html>
|