//APP.vue
mounted() {
if (this._isMobile()) {
console.log("手机端");
this.$router.push("/index");
} else {
console.log("pc端");
this.$router.push("/index");
}
},
methods: {
//App.vue
_isMobile() {
let flag = navigator.userAgent.match(
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
);
return flag;
},
},