|
@@ -78,13 +78,20 @@ router.beforeEach((to, from, next) => {
|
|
|
})
|
|
|
} else {
|
|
|
// next()
|
|
|
- console.log(from, to)
|
|
|
+ // console.log(from, to)
|
|
|
+ // console.log(from.meta.replace)
|
|
|
// 从添加页面跳转其他页面后需要删除联锁添加页面
|
|
|
- if(from.path === '/interLock/summary/set' && !from.meta.replace){
|
|
|
+ if(from.path === '/interLock/summary/set'){
|
|
|
// 为了解决循环设置了replace
|
|
|
- from.meta.replace = true
|
|
|
- next({ ...to, replace: true })
|
|
|
- from.meta.replace = false
|
|
|
+ if(!from.meta.replace){
|
|
|
+ from.meta.replace = true
|
|
|
+ next({ ...to, replace: true })
|
|
|
+ } else {
|
|
|
+ from.meta.replace = false
|
|
|
+ }
|
|
|
+ // console.log(11111)
|
|
|
+ // console.log(from)
|
|
|
+ // from.meta.replace = false
|
|
|
} else {
|
|
|
next()
|
|
|
}
|
|
@@ -157,13 +164,19 @@ router.beforeEach((to, from, next) => {
|
|
|
})
|
|
|
})
|
|
|
} else {
|
|
|
- console.log(from, to)
|
|
|
+ // console.log(from, to)
|
|
|
// 从添加页面跳转其他页面后需要删除联锁添加页面
|
|
|
- if(from.path === '/interLock/summary/set' && !from.meta.replace){
|
|
|
+ if(from.path === '/interLock/summary/set'){
|
|
|
// 为了解决循环设置了replace
|
|
|
- from.meta.replace = true
|
|
|
- next({ ...to, replace: true })
|
|
|
- from.meta.replace = false
|
|
|
+ // from.meta.replace = true
|
|
|
+ // next({ ...to, replace: true })
|
|
|
+ // from.meta.replace = false
|
|
|
+ if(!from.meta.replace){
|
|
|
+ from.meta.replace = true
|
|
|
+ next({ ...to, replace: true })
|
|
|
+ } else {
|
|
|
+ from.meta.replace = false
|
|
|
+ }
|
|
|
} else {
|
|
|
next()
|
|
|
}
|