function isPCFun() {
var isMobile = navigator.userAgent.match(
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
); // 是否移动端
var isWx = /micromessenger/i.test(navigator.userAgent); // 是否微信
var isComWx = /wxwork/i.test(navigator.userAgent); // 是否企业微信
let platform = '';
if (isComWx && isMobile) {
platform = '移动端企业微信';
} else if (isComWx && !isMobile) {
platform = 'PC端企业微信';
} else if (isWx && isMobile) {
platform = '移动端微信';
} else if (isWx && !isMobile) {
platform = 'PC端微信';
}
return platform;
}
js判断是微信端还是企业微信端
最新推荐文章于 2024-04-10 16:40:52 发布