Browse Source

修复首页路由

还没未修复完毕 暂时有bug
mo 3 years ago
parent
commit
61fcd71858
2 changed files with 15 additions and 3 deletions
  1. 14 2
      src/router/index.js
  2. 1 1
      src/store/modules/permission.js

+ 14 - 2
src/router/index.js

@@ -97,8 +97,20 @@ export const constantRoutes = [
 
   {
     path: '/',
-    redirect: '/main/main',
-    hidden: true
+    component: Layout,
+    hidden: true,
+    children: [{
+      name: '首页',
+      path: '/',
+      component: () => import('@/views/main/index'),
+      hidden: false,
+      belongTopMenu: "/main",
+      activeMenu: '/main/main',
+      meta: {
+        noCache: '1',
+        title: '首页'
+      }
+    }]
   },
   {
     path: '/redirect',

+ 1 - 1
src/store/modules/permission.js

@@ -166,7 +166,7 @@ function addTopMenu(arr) {
       }
       let obj = arr[i]
       obj.belongTopMenu = obj.path
-
+      console.log(obj.path)
       if (arr[i].sysMenus && arr[i].sysMenus.length > 0) {
         obj.sysMenus = setTopMenu(arr[i].sysMenus, obj);
       }