userAgent判断是微信还是企业微信

<script>
var ua= window.navigator.userAgent.toLowerCase();
if( (ua.match(/MicroMessenger/i) == 'micromessenger') && (ua.match(/wxwork/i) == 'wxwork') ){
alert("企业微信客户端");
}else if( ua.match(/micromessenger/i) == 'micromessenger' ){
alert("微信客户端");
}
</script>

posted @ 2021-10-11 14:51  举个栗子走天下  阅读(1141)  评论(0编辑  收藏  举报