[update 飞书跳转移动端] 临时增加移动端页面

This commit is contained in:
danshihao
2024-08-08 16:28:11 +08:00
parent bb5ecb6f27
commit 367c1bd1b7
5 changed files with 74 additions and 2 deletions
+25
View File
@@ -761,3 +761,28 @@ export function findNodeByField (tree, findVal, valueField = 'id', childrenField
}
return null
}
// 判断当前是否移动端
export function isMobile () {
const userAgentInfo = navigator.userAgent
const mobileAgents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']
let mobileFlag = false
// 根据userAgent判断是否是手机
for (let v = 0; v < mobileAgents.length; v++) {
if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
mobileFlag = true
break
}
}
const screenWidth = window.screen.width
const screenHeight = window.screen.height
// 根据屏幕分辨率判断是否是手机
if (screenWidth < 500 && screenHeight < 800) {
mobileFlag = true
}
return mobileFlag
}