如果是手机系统, 那么redirect页面将不再自动跳转

This commit is contained in:
zhl 2023-04-17 10:42:09 +08:00
parent 15f0b970c8
commit 24333d23cf

View File

@ -25,7 +25,8 @@
</head> </head>
<body> <body>
<h1>跳转中...</h1> <h1>请选择操作...</h1>
<p><a href="" id="href">点击跳转至操作页面</a></p>
<script nonce="rAnd0m"> <script nonce="rAnd0m">
(function() { (function() {
var urlBase = 'xwork.kingsome.cn/workflow/confirm/<%= id %>' var urlBase = 'xwork.kingsome.cn/workflow/confirm/<%= id %>'
@ -34,9 +35,11 @@
// if current devices is mobile, redirect url1, else redirect url2 // if current devices is mobile, redirect url1, else redirect url2
if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) { if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
url = urlMobile url = urlMobile
} document.getElementById('href').attr('href', url)
console.log(url) } else {
location.href = url location.href = url
}
})() })()
</script> </script>
</body> </body>