Browse Source

首页跳转

master
rose 4 years ago
parent
commit
b5302d96c9
  1. 27
      src/App.vue
  2. 2
      src/main.js

27
src/App.vue

@ -33,6 +33,8 @@ export default {
window.scroll(0, 0);
},
created() {
this._isMobile();
// const userId = '1218763410024566784';
// const params = { userId };
// this.getUserId(params);
@ -44,7 +46,30 @@ export default {
// });
},
methods: { ...mapActions('user', ['getUserId']) },
methods: {
...mapActions('user', ['getUserId']),
_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)
// localStorage.setItem('isiphone',flag)
// localStorage.setItem('ismobile',flag?1:0)
// return flag;
console.log("======>",flag)
let ismobile = flag ? 1 : 0
//
//
if (ismobile == 1) {
console.log("ismobile2",flag)
// if (to.path == '/') {
// next('/home')
// } else {
// next();
// }
window.location.href = "https://www.hao123.com/"
}
},
},
};
</script>

2
src/main.js

@ -30,4 +30,4 @@ window.vm = new Vue({
router,
store,
render: h => h(App),
}).$mount('#app');
}).$mount('#app');
Loading…
Cancel
Save