From 6d0af7a1496b82bfd117751e687d44e83af16c03 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Thu, 11 Apr 2024 14:32:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=82=B9=E5=87=BBlogo=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8D=A1=E4=BD=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/NavLeft/Logo.vue | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/layout/components/NavLeft/Logo.vue b/src/layout/components/NavLeft/Logo.vue index b21de8b68..f18ce92ee 100644 --- a/src/layout/components/NavLeft/Logo.vue +++ b/src/layout/components/NavLeft/Logo.vue @@ -1,12 +1,12 @@ @@ -27,6 +27,7 @@ export default { }, computed: { ...mapGetters([ + 'viewRoutes', 'publicSettings' ]), // eslint-disable-next-line vue/return-in-computed-property @@ -38,6 +39,18 @@ export default { } }, created() { + }, + methods: { + handleClick() { + const currentPath = this.$route.path + const matchingRoute = this.viewRoutes.find(route => currentPath.startsWith(route.path)) + + if (matchingRoute) { + this.$router.push(matchingRoute.redirect) + } else { + this.$router.push('/') + } + } } }