king
2 天以前 047dbd742341e268ca772eda8d2ff0b6ba09cb44
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
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title></title>
  </head>
  <body>
    <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>'
        }
      } else {
        fetch(`./options.json`)
          .then(function(response) {return response.json()})
          .catch(function() {
            document.body.innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">系统配置信息获取失败,请联系管理员!</div>'
          })
          .then(function(config) {
            if (!config) {
              document.body.innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">系统配置信息获取失败,请联系管理员!</div>'
            } else {
              var url = window.location.href.split(/index\.html|#/ig)[0].replace(/\/$/ig, '')
              var appPort = '/admin/index.html'
 
              if (config.defaultApp) {
                if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
                  appPort = '/mob/index.html#/index'
                } else {
                  appPort = '/pc/index.html#/index'
                }
              }
              window.location.replace(url + appPort)
            }
          })
      }
    </script>
  </body>
</html>