Browse Source

处理中途返回

master
453530270@qq.com 2 years ago
parent
commit
dc7923ab1c
  1. 3
      components/shortcut/index.vue
  2. 2
      pages/findpass/findpass.vue
  3. 25
      pages/login/index.vue

3
components/shortcut/index.vue

@ -62,9 +62,6 @@
methods: {
/**
* 导航菜单切换事件
*/

2
pages/findpass/findpass.vue

@ -52,7 +52,7 @@
methods: {
//
gologin(){
this.$navTo("pages/login/index")
this.$navTo("pages/login/index")
},
}
}

25
pages/login/index.vue

@ -121,17 +121,18 @@
mounted() {
// ,
if(window.history && window.history.pushState){
console.log(window.history)
history.pushState(null, null, document.URL)
window.addEventListener('popstate',this.goback,false)
}
},
destroyed() {
window.removeEventListener('popstate', this.goback, false)
},
methods: {
//
goback(){
console.log("6666666666666666666")
// let path = this.$route.path
// this.$toast(path)
this.onNavigateBack(1)
this.$navTo("pages/index/index")
//this.$router.replace('pages/index/index')
},
//
radioChange(evt) {
@ -241,8 +242,8 @@
delta: Number(delta || 1)
})
} else {
//this.$navTo('pages/user/index')
this.$navTo('pages/index/index')
this.$navTo('pages/user/index')
// this.$navTo('pages/index/index')
}
},
@ -270,10 +271,10 @@
},
//退
destroyed(){
//
window.removeEventListener('popstate',this.goback,false)
}
// destroyed(){
// //
// window.removeEventListener('popstate',this.goback,false)
// }
}
</script>

Loading…
Cancel
Save