|
@@ -21,6 +21,25 @@ export default {
|
|
setToken('');
|
|
setToken('');
|
|
sessionStorage.removeItem("route")
|
|
sessionStorage.removeItem("route")
|
|
this.$router.push(`/login`);
|
|
this.$router.push(`/login`);
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ $route(to, from) {
|
|
|
|
+ const { tagsView } = this.$store.state
|
|
|
|
+ const whiteList = ['/hospital-search', '/hospital-caseViews', '/hospital-details', '/hospital-chargeDetails']
|
|
|
|
+ if (tagsView && tagsView.visitedViews.length) {
|
|
|
|
+ let bSwitch = 1
|
|
|
|
+ tagsView.visitedViews.map(item => {
|
|
|
|
+ if (whiteList.includes(item.path)) {
|
|
|
|
+ bSwitch = 0
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ if (bSwitch) {
|
|
|
|
+ sessionStorage.removeItem("jingmiao_token")
|
|
|
|
+ sessionStorage.removeItem("route")
|
|
|
|
+ this.$router.push(`/login`);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|