util.js 357 字节
Newer Older
!阳仔's avatar
!阳仔 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
export const isMobile = () => {
  var ua = window.navigator.userAgent
  if (
    ua.match(/Android/i) ||
    ua.match(/webOS/i) ||
    ua.match(/SymbianOS/i) ||
    ua.match(/iPhone/i) ||
    ua.match(/iPad/i) ||
    ua.match(/iPod/i) ||
    ua.match(/BlackBerry/i) ||
    ua.match(/Windows Phone/i)
  ) {
    return true;
  } else {
    return false;
  }
}