diff --git a/js/version.txt b/js/version.txt index 17c0840..4c774e7 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.9.43beta5 \ No newline at end of file +3.9.43beta6 \ No newline at end of file diff --git a/templates/admin.html b/templates/admin.html index f7e8387..74e58fb 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -21,10 +21,11 @@ function isPhone() { //获取浏览器navigator对象的userAgent属性(浏览器用于HTTP请求的用户代理头的值) var info = navigator.userAgent; - console.log('navigator.userAgent:',info); + var isMobile = /iPhone|iPad|iPod|Android|mobile/i.test(info) || window.screen.width < 768 || window.screen.height < 768; + console.log('navigator.userAgent:',info,'isMobile:',isMobile); //通过正则表达式的test方法判断是否包含“Mobile”字符串 //如果包含“Mobile”(是手机设备)则返回true - return /mobile/i.test(info); + return isMobile; } const IS_MOBILE = isPhone(); console.log('IS_MOBILE:',IS_MOBILE);