判断当前页面是通过什么设备打开
1 let ua = window.navigator.userAgent.toLowerCase(); 2 let isWeiXin = false; 3 let isDingTalk = false; 4 if (ua.match(/MicroMessenger/i) == "micromessenger") {//用微信打开 5 isWeiXin = true 6 }else if(ua.match(/DingTalk/i)=="dingtalk"){ //用钉钉打开 7 isDingTalk = true; 8 } else { //用其他浏览器打开 9 10 }