前端机型判断:
var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //判断是否是 android终端 var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); console.log(isIOS) console.log(isAndroid)