<!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>
|