feat: 前端无需二次判断路由权限

This commit is contained in:
WANGFan 2025-07-12 10:14:39 +08:00
parent 56483166fe
commit 035828e2aa

View File

@ -3,7 +3,6 @@ import { storeToRefs } from "pinia";
import { useRoutesConfigStore } from "@/store/modules/route-config"; import { useRoutesConfigStore } from "@/store/modules/route-config";
import { useThemeConfig } from "@/store/modules/theme-config"; import { useThemeConfig } from "@/store/modules/theme-config";
import { deepClone, arrayFlattened } from "@/utils/index"; import { deepClone, arrayFlattened } from "@/utils/index";
import { useRoutingMethod } from "@/hooks/useRoutingMethod";
/** /**
* *
@ -32,11 +31,6 @@ export const currentlyRoute = (current: any) => {
store.setTabs(routeList.value[0]); store.setTabs(routeList.value[0]);
} }
// 跳转路由是有权限的,从有权限路由中匹配
const { hasRoute } = useRoutingMethod();
// 未找到,说明当前跳转路由无权限
if (!hasRoute(route.name)) return;
// 存入当前路由-高亮 // 存入当前路由-高亮
store.setCurrentRoute(route); store.setCurrentRoute(route);