indexhtml添加移动端pc端判断
This commit is contained in:
parent
b4dadbee38
commit
0f08a3ec04
|
|
@ -10,7 +10,11 @@
|
|||
|
||||
<body>
|
||||
<script>
|
||||
window.location.href = '/mobile'
|
||||
var isMobile = function () {
|
||||
var u = navigator.userAgent
|
||||
return /Mobile|Android|webOS|iPhone|iPad|Phone/i.test(u)
|
||||
}
|
||||
window.location.href = isMobile() ? '/mobile' : '/pc'
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue