|
|
@ -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> |
|
|
|
|
|
|
|