MUI识别移动设备系统(主要用于区分苹果还是安卓)

//检测移动设备型号
        var ua = navigator.userAgent.toLowerCase();
        console.log('ua:'+ua);
        if(/iphone|ipad|ipod/.test(ua)) {    //苹果手机 
            console.log('ios系统');
        }else if(/android/.test(ua)) {    //安卓手机
            console.log('安卓系统');
        }

 

posted @ 2020-05-14 17:14  农名工进城  阅读(703)  评论(0编辑  收藏  举报