1
//安卓客户端
const isAndroid = window.navigator.userAgent.indexOf("Android") >= 0;
//IOS客户端
const isIOS = /(iPhone|iPad|iPod|iOS|Mac)/i.test(navigator.userAgent);
//判断app
const userAgent = window.navigator.userAgent;
const isApp = userAgent.indexOf("自定义参数") !== -1 || userAgent.search("自定义参数") !== -1 || /(自定义参数)/.test(userAgent);
//微信内置浏览器
const isWeChat = navigator.userAgent.match(/(MicroMessenger)/i) !== null;

buddha
130 声望2 粉丝

解决移动端技术问题的三大法宝:重启、刷新、换手机