mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复Mac下的微信浏览器被识别为移动端问题
This commit is contained in:
@@ -116,4 +116,14 @@ public class OS extends UserAgentInfo {
|
||||
}
|
||||
return ReUtil.getGroup1(this.versionPattern, userAgentString);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为MacOS
|
||||
*
|
||||
* @return 是否为MacOS
|
||||
* @since 5.8.29
|
||||
*/
|
||||
public boolean isMacOS(){
|
||||
return "OSX".equals(getName());
|
||||
}
|
||||
}
|
||||
|
@@ -52,8 +52,13 @@ public class UserAgentParser {
|
||||
// 平台
|
||||
final Platform platform = parsePlatform(userAgentString);
|
||||
userAgent.setPlatform(platform);
|
||||
userAgent.setMobile(platform.isMobile() || browser.isMobile());
|
||||
|
||||
// issue#IA74K2 MACOS下的微信不属于移动平台
|
||||
if(platform.isMobile() || browser.isMobile()){
|
||||
if(false == os.isMacOS()){
|
||||
userAgent.setMobile(true);
|
||||
}
|
||||
}
|
||||
|
||||
return userAgent;
|
||||
}
|
||||
|
Reference in New Issue
Block a user