直接记录代码
const ua = navigator.userAgent
function getType(){
if (ua.match(/iPhone OS|iPad/i)) {
return "ios"
} else if (ua.match(/Android/)) {
return "android"
} if (ua.match(/Mac OS X/i)) {
return "mac"
} else {
return "win"
}
}