判断安卓苹果ipad,iphone,微信

 1 export default function () {
 2     const json = {
 3         userAgent: navigator.userAgent.toLowerCase(),
 4         isAndroid: Boolean(navigator.userAgent.match(/android/ig)),
 5         isIphone: Boolean(navigator.userAgent.match(/iphone|ipod/ig)),
 6         isIpad: Boolean(navigator.userAgent.match(/ipad/ig)),
 7         isWeixin: Boolean(navigator.userAgent.match(/MicroMessenger/ig)),
 8     };
 9     return json;
10 }

 

posted @ 2018-12-27 11:13  丶漏电姐姐  阅读(212)  评论(0编辑  收藏  举报