king
2025-05-12 7310a6b52d482562ab1495bdc8d0aed41092ba65
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!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 = '') {
        if (color) {
          console.info(value, color)
        } else {
          console.info(value)
        }
      }
    </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>