fix: 跳转不存在的路由空白页面问题修复

Former-commit-id: c797a3a474df0d0ec78daafff27f52e47d1d3777
This commit is contained in:
郝先瑞
2022-05-18 23:54:54 +08:00
parent 50c5c1ad2f
commit 14d7d879a0
2 changed files with 14 additions and 6 deletions

View File

@@ -69,7 +69,7 @@ import LangSelect from '@/components/LangSelect/index.vue';
// 图标依赖
import { CaretBottom } from '@element-plus/icons-vue';
const { app, user } = useStore();
const { app, user, tagsView } = useStore();
const route = useRoute();
const router = useRouter();
@@ -88,9 +88,14 @@ function logout() {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
user.logout().then(() => {
router.push(`/login?redirect=${route.fullPath}`);
});
user
.logout()
.then(() => {
tagsView.delAllViews();
})
.then(() => {
router.push(`/login?redirect=${route.fullPath}`);
});
});
}
</script>