indexhtml添加移动端pc端判断

This commit is contained in:
Jason 2023-01-10 17:12:01 +08:00
parent b4dadbee38
commit 0f08a3ec04
1 changed files with 5 additions and 1 deletions

View File

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