浏览代码

🎨 去除无用log

晓晓晓晓丶vv 4 年之前
父节点
当前提交
d2bdeb11f2
共有 2 个文件被更改,包括 0 次插入31 次删除
  1. 0 1
      src/layout/components/AppSubMenu.vue
  2. 0 30
      src/router/permission.ts

+ 0 - 1
src/layout/components/AppSubMenu.vue

@@ -37,7 +37,6 @@ const AppSubMenu = defineComponent({
     parentPath: String,
   },
   setup(props) {
-    console.log(props.menus);
     const formatRoutes = (path: string, base: string = "/") =>
       pathResolve(path, base);
 

+ 0 - 30
src/router/permission.ts

@@ -11,36 +11,6 @@ import { ActionType } from "@/store/modules/app/actions";
 const WHITE_URL_LIST: string[] = ["/login", "/forget"];
 
 /**
- * 权限动态路由合并
- * TODO 外部封装next函数有问题
- * @param to
- * @param next
- */
-const generatorRoutes = async (
-  to: RouteLocationNormalized,
-  next: NavigationGuardNext
-) => {
-  const roles = store.getters["system/userRoles"];
-  if (roles.length) next();
-  else {
-    const userRoles: string[] = await store.dispatch("system/getUserRoles");
-    const webRoutes: RouteConfig[] = await store.dispatch(
-      "system/generatorRoutes",
-      userRoles
-    );
-    const AppRoute: RouteConfig = {
-      name: "home",
-      path: "/",
-      redirect: webRoutes[0].path,
-      component: Layout,
-      children: webRoutes,
-    };
-    router.addRoute(AppRoute);
-    next({ ...to, replace: true, name: to.name! });
-  }
-};
-
-/**
  * 未登录的情况下 路由的处理
  * @param to
  * @param next