isPC.js 311 B

123456789101112
  1. export function isPC() {
  2. var userAgentInfo = navigator.userAgent;
  3. var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
  4. var flag = true;
  5. for (let v = 0; v < Agents.length - 1; v++) {
  6. if (userAgentInfo.indexOf(Agents[v]) > 0) {
  7. flag = false;
  8. break;
  9. }
  10. }
  11. return flag;
  12. }