vue determine the type of client is a mobile phone or computer

 bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
        var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
        if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
        } else {
            const mUrl = location.origin + location.pathname.replace(/m/, "p") + location.search;
            console.log(mUrl);
            location.href = mUrl;
        }
    }
    browserRedirect();
</script>

Reproduced to the network, if infringement, contact the author.

Guess you like

Origin www.cnblogs.com/y-shmily/p/12188433.html