From eb3f640c670dc44e885acbc52405fbddb09a252a Mon Sep 17 00:00:00 2001 From: qiang Date: Mon, 1 Jun 2020 15:57:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20H5=20=E4=BF=AE=E5=A4=8D=20PC=20=E7=AB=AF?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=B1=8F=E5=B9=95=E5=AE=BD=E9=AB=98=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/platforms/h5/service/api/device/get-system-info.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/h5/service/api/device/get-system-info.js b/src/platforms/h5/service/api/device/get-system-info.js index d4a66c34..25cdb55a 100644 --- a/src/platforms/h5/service/api/device/get-system-info.js +++ b/src/platforms/h5/service/api/device/get-system-info.js @@ -18,8 +18,8 @@ export function getSystemInfoSync () { var pixelRatio = window.devicePixelRatio // 横屏时 iOS 获取的屏幕宽高颠倒,进行纠正 var landscape = Math.abs(window.orientation) === 90 - var screenWidth = Math[landscape ? 'max' : 'min'](screen.width, screen.height) - var screenHeight = Math[landscape ? 'min' : 'max'](screen.height, screen.width) + var screenWidth = typeof window.orientation === 'number' ? Math[landscape ? 'max' : 'min'](screen.width, screen.height) : screen.width + var screenHeight = typeof window.orientation === 'number' ? Math[landscape ? 'min' : 'max'](screen.height, screen.width) : screen.height var windowWidth = Math.min(window.innerWidth, document.documentElement.clientWidth, screenWidth) var windowHeight = window.innerHeight var language = navigator.language -- GitLab