提交 18a9fda4 编写于 作者: D DCloud_LXH

fix(h5): getSystemInfo添加H5对iPadOS的判断

上级 784f4c8b
...@@ -23,6 +23,10 @@ const isMac = /Macintosh|Mac/i.test(ua) ...@@ -23,6 +23,10 @@ const isMac = /Macintosh|Mac/i.test(ua)
* 是否是Linux设备 * 是否是Linux设备
*/ */
const isLinux = /Linux|X11/i.test(ua) const isLinux = /Linux|X11/i.test(ua)
/**
* 是否是iPadOS
*/
const isIPadOS = isMac && navigator.maxTouchPoints > 0
/** /**
* 获取系统信息-同步 * 获取系统信息-同步
*/ */
...@@ -81,6 +85,10 @@ export function getSystemInfoSync () { ...@@ -81,6 +85,10 @@ export function getSystemInfoSync () {
break break
} }
} }
} else if (isIPadOS) {
model = 'iPad'
osname = 'iPadOS'
osversion = window.BigInt ? '14' : '13'
} else if (isWindows || isMac || isLinux) { } else if (isWindows || isMac || isLinux) {
model = 'PC' model = 'PC'
const osversionFind = ua.match(/\((.+?)\)/)[1] const osversionFind = ua.match(/\((.+?)\)/)[1]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册