|
@@ -20,21 +20,40 @@ import empty from '@/components/common/Empty.vue'
|
|
|
})
|
|
|
|
|
|
export default class Page404 extends Vue {
|
|
|
- created () {
|
|
|
- const route = this.$route
|
|
|
- const redirectedFrom = route.redirectedFrom
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ console.log(to, from)
|
|
|
+ const isWeiXinBrowser = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
|
|
|
+ const redirectedFrom = to.redirectedFrom
|
|
|
+ console.log(redirectedFrom, isWeiXinBrowser)
|
|
|
if (redirectedFrom) {
|
|
|
- console.log('路由:%c %s %c未找到', 'color: red', redirectedFrom, 'color: #000')
|
|
|
- if (this.$env.isWeiXinBrowser) {
|
|
|
+ if (isWeiXinBrowser) {
|
|
|
if (redirectedFrom.indexOf('integralDetail') > -1) {
|
|
|
- window.location.href = window.location.origin + redirectedFrom
|
|
|
+ location.replace(window.location.origin + redirectedFrom)
|
|
|
}
|
|
|
} else {
|
|
|
if (redirectedFrom.indexOf('tointegralDetail') > -1) {
|
|
|
- window.location.href = window.location.origin + redirectedFrom
|
|
|
+ location.replace(window.location.origin + redirectedFrom)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ next()
|
|
|
+ }
|
|
|
+
|
|
|
+ created () {
|
|
|
+ // const route = this.$route
|
|
|
+ // const redirectedFrom = route.redirectedFrom
|
|
|
+ // if (redirectedFrom) {
|
|
|
+ // console.log('路由:%c %s %c未找到', 'color: red', redirectedFrom, 'color: #000')
|
|
|
+ // if (this.$env.isWeiXinBrowser) {
|
|
|
+ // if (redirectedFrom.indexOf('integralDetail') > -1) {
|
|
|
+ // location.replace(window.location.origin + redirectedFrom)
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // if (redirectedFrom.indexOf('tointegralDetail') > -1) {
|
|
|
+ // location.replace(window.location.origin + redirectedFrom)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
</script>
|