From d0108abc9ef5f451363f3f5e9730f5e8fa8f3e3d Mon Sep 17 00:00:00 2001 From: "chen.home" <1147347984@qq.com> Date: Sun, 26 Mar 2023 19:23:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(router):=20=E5=AE=8C=E5=96=84=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E6=98=BE=E7=A4=BA=E5=92=8Cmeta=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/module/user.ts | 19 ++- src/layouts/components/header/Breadcrumb.vue | 8 +- src/router/guard/dynamic.ts | 39 ++++-- src/store/modules/route.ts | 122 ++++++++++++------- src/views/plugin/map/index.vue | 13 +- src/views/test/test1/index.vue | 1 + src/views/test/test2/index.vue | 6 +- src/views/test/test3/index.vue | 7 -- src/views/test/test3/test4/index.vue | 16 ++- 9 files changed, 145 insertions(+), 86 deletions(-) delete mode 100644 src/views/test/test3/index.vue diff --git a/mock/module/user.ts b/mock/module/user.ts index 3398027..a6df3b5 100644 --- a/mock/module/user.ts +++ b/mock/module/user.ts @@ -35,7 +35,6 @@ const userRoutes = [ { name: 'dashboard', path: '/dashboard', - redirect: '/dashboard/workbench', meta: { title: '仪表盘', requiresAuth: true, @@ -65,7 +64,6 @@ const userRoutes = [ { name: 'test', path: '/test', - redirect: '/test/test1', meta: { title: '多级菜单演示', requiresAuth: true, @@ -76,7 +74,7 @@ const userRoutes = [ name: 'test1', path: '/test/test1', meta: { - title: '多级菜单1', + title: '接口功能测试', requiresAuth: true, icon: 'icon-park-outline:list', }, @@ -85,7 +83,7 @@ const userRoutes = [ name: 'test2', path: '/test/test2', meta: { - title: '多级菜单2', + title: '多级菜单子页', requiresAuth: true, icon: 'icon-park-outline:list', }, @@ -94,7 +92,7 @@ const userRoutes = [ name: 'test2_detail', path: '/test/test2/detail', meta: { - title: '多级菜单2的详情页', + title: '多级菜单的详情页', requiresAuth: true, icon: 'icon-park-outline:list', hide: true, @@ -107,7 +105,7 @@ const userRoutes = [ name: 'test3', path: '/test/test3', meta: { - title: '多级菜单3', + title: '多级菜单', requiresAuth: true, icon: 'icon-park-outline:list', }, @@ -128,7 +126,6 @@ const userRoutes = [ { name: 'list', path: '/list', - redirect: '/list/commonList', meta: { title: '列表页', requiresAuth: true, @@ -158,7 +155,6 @@ const userRoutes = [ { name: 'plugin', path: '/plugin', - redirect: '/plugin/charts', meta: { title: '组件示例', requiresAuth: true, @@ -265,7 +261,6 @@ const userRoutes = [ { name: 'docments', path: '/docments', - redirect: '/docments/vue', meta: { title: '外链文档', requiresAuth: true, @@ -305,7 +300,6 @@ const userRoutes = [ { name: 'permission', path: '/permission', - redirect: '/permission/permission', meta: { title: '权限示例', requiresAuth: true, @@ -336,7 +330,6 @@ const userRoutes = [ { name: 'error', path: '/error', - redirect: '/error/403', meta: { title: '异常页', requiresAuth: true, @@ -350,6 +343,7 @@ const userRoutes = [ title: '403页', requiresAuth: true, icon: 'carbon:error', + order: 3, }, }, { @@ -359,6 +353,7 @@ const userRoutes = [ title: '404页', requiresAuth: true, icon: 'icon-park-outline:error', + order: 2, }, }, { @@ -368,6 +363,7 @@ const userRoutes = [ title: '500页', requiresAuth: true, icon: 'carbon:data-error', + order: 1, }, }, ], @@ -375,7 +371,6 @@ const userRoutes = [ { name: 'setting', path: '/setting', - redirect: '/setting/account', meta: { title: '系统设置', requiresAuth: true, diff --git a/src/layouts/components/header/Breadcrumb.vue b/src/layouts/components/header/Breadcrumb.vue index 93f70fc..8023b43 100644 --- a/src/layouts/components/header/Breadcrumb.vue +++ b/src/layouts/components/header/Breadcrumb.vue @@ -1,6 +1,10 @@