Commit 6e81e121 by 李伟康

feat(utils): 更新移动端设备检测逻辑

- 在 isMobileDevice 函数中增加了对 OpenHarmony 和 Harmony 系统的识别
- 保持了原有的移动端设备检测功能不变
- 优化了设备检测的正则表达式匹配规则
1 parent b44b43dc
......@@ -233,7 +233,7 @@ const toUnicode = (chineseStr = '') => {
const isMobileDevice = () => {
//判断当前设备是否为移动端
const ua = navigator.userAgent.toLowerCase()
const t1 = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(ua)
const t1 = /android|webos|iphone|ipad|ipod|blackberry|iemobile|OpenHarmony|Harmony|opera mini/i.test(ua)
const t2 = !ua.match('iphone') && navigator.maxTouchPoints > 1
return t1 || t2
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!