const isWx = function() {
  const u = navigator.userAgent.toLowerCase();
  if (u.match(/MicroMessenger/i)) {
    return true;
  } else {
    return false;
  }
};
const isMobile = function() {
  if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
    return true;
  } else {
    return false;
  }
};
const isIos = function() {
  const u = navigator.userAgent;
  if (u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/i)) {
    return true;
  } else {
    return false;
  }
};
const isAndroid = function() {
  const u = navigator.userAgent;
  if (u.indexOf("Android") > -1 || u.indexOf("Linux") > -1) {
    return true;
  } else {
    return false;
  }
};
export default {
  isWx,
  isMobile,
  isIos,
  isAndroid
};
