|
@@ -92,16 +92,16 @@ export default {
|
|
$route: {
|
|
$route: {
|
|
handler: function (route) {
|
|
handler: function (route) {
|
|
this.redirect = route.query && route.query.redirect;
|
|
this.redirect = route.query && route.query.redirect;
|
|
- this.preUrl = !!this.$route.query.preUrl ? this.$route.query.preUrl : sessionStorage.getItem('preUrl')
|
|
|
|
- // this.preUrl = !!this.$route.query.preUrl ? this.$route.query.preUrl : undefined
|
|
|
|
|
|
+ // this.preUrl = !!this.$route.query.preUrl ? this.$route.query.preUrl : sessionStorage.getItem('preUrl')
|
|
|
|
+ this.preUrl = !!this.$route.query.preUrl ? this.$route.query.preUrl : undefined
|
|
},
|
|
},
|
|
immediate: true,
|
|
immediate: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- this.preUrl = !!this.$route.query.preUrl ? this.$route.query.preUrl : sessionStorage.getItem('preUrl')
|
|
|
|
- // this.preUrl = !!this.$route.query.preUrl ? this.$route.query.preUrl : undefined
|
|
|
|
|
|
+ // this.preUrl = !!this.$route.query.preUrl ? this.$route.query.preUrl : sessionStorage.getItem('preUrl')
|
|
|
|
+ this.preUrl = !!this.$route.query.preUrl ? this.$route.query.preUrl : undefined
|
|
})
|
|
})
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -137,18 +137,34 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- if (bSwitch.includes(1) && this.preUrl === 'hospital') {
|
|
|
|
- sessionStorage.setItem('preUrl', 'hospital')
|
|
|
|
- this.$router.push({ path: '/hospital'});
|
|
|
|
- } else if (bSwitch.includes(2) && this.preUrl === 'embedIndex') {
|
|
|
|
- sessionStorage.setItem('preUrl', 'embedIndex')
|
|
|
|
- this.$router.push({ path: '/embedIndex' });
|
|
|
|
- } else if (bSwitch.includes(3) && this.preUrl === 'reviewIndex') {
|
|
|
|
- sessionStorage.setItem('preUrl', 'reviewIndex')
|
|
|
|
- this.$router.push({ path: '/reviewIndex' });
|
|
|
|
|
|
+ if (this.preUrl) {
|
|
|
|
+ if (bSwitch.includes(1) && this.preUrl === 'hospital') {
|
|
|
|
+ sessionStorage.setItem('preUrl', 'hospital')
|
|
|
|
+ this.$router.push({ path: '/hospital'});
|
|
|
|
+ } else if (bSwitch.includes(2) && this.preUrl === 'embedIndex') {
|
|
|
|
+ sessionStorage.setItem('preUrl', 'embedIndex')
|
|
|
|
+ this.$router.push({ path: '/embedIndex' });
|
|
|
|
+ } else if (bSwitch.includes(3) && this.preUrl === 'reviewIndex') {
|
|
|
|
+ sessionStorage.setItem('preUrl', 'reviewIndex')
|
|
|
|
+ this.$router.push({ path: '/reviewIndex' });
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('没有页面权限,请联系管理员!')
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
this.$router.push(this.redirect || '/');
|
|
this.$router.push(this.redirect || '/');
|
|
}
|
|
}
|
|
|
|
+ // if (bSwitch.includes(1) && this.preUrl === 'hospital') {
|
|
|
|
+ // sessionStorage.setItem('preUrl', 'hospital')
|
|
|
|
+ // this.$router.push({ path: '/hospital'});
|
|
|
|
+ // } else if (bSwitch.includes(2) && this.preUrl === 'embedIndex') {
|
|
|
|
+ // sessionStorage.setItem('preUrl', 'embedIndex')
|
|
|
|
+ // this.$router.push({ path: '/embedIndex' });
|
|
|
|
+ // } else if (bSwitch.includes(3) && this.preUrl === 'reviewIndex') {
|
|
|
|
+ // sessionStorage.setItem('preUrl', 'reviewIndex')
|
|
|
|
+ // this.$router.push({ path: '/reviewIndex' });
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$router.push(this.redirect || '/');
|
|
|
|
+ // }
|
|
}).catch((e) => {
|
|
}).catch((e) => {
|
|
console.log(e)
|
|
console.log(e)
|
|
this.$message.error('获取导航菜单失败!');
|
|
this.$message.error('获取导航菜单失败!');
|