diff --git a/src/components/AppLayout/AppLayout.vue b/src/components/AppLayout/AppLayout.vue index 38504ac..34eef64 100644 --- a/src/components/AppLayout/AppLayout.vue +++ b/src/components/AppLayout/AppLayout.vue @@ -57,7 +57,10 @@ function logout() { router.push('/login') } function isActive(path: string): boolean { - return path === '/' ? route.path === '/' : route.path.startsWith(path) + if (path === '/') return route.path === '/' + // 严格匹配: route.path 完全等于 path, 或 route.path 是 path 的子路径 (path 后必须是 '/') + // 避免 '/user/enterprise/rating' 同时匹配 '/user/enterprise' (前缀误激活) + return route.path === path || route.path.startsWith(path + '/') } /** diff --git a/src/modules/user/enterpriserating/EnterpriseratingListView.vue b/src/modules/user/enterpriserating/EnterpriseratingListView.vue index c868516..6cae1ad 100644 --- a/src/modules/user/enterpriserating/EnterpriseratingListView.vue +++ b/src/modules/user/enterpriserating/EnterpriseratingListView.vue @@ -1,108 +1,122 @@