From 20ae0a30e0663f29150a8cf29ba02809a55e97d0 Mon Sep 17 00:00:00 2001 From: Dong Xia Date: Fri, 3 Feb 2023 05:12:05 +0000 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=B7=AF=E7=94=B1=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dong Xia --- src/router/index.js | 72 ++++++++++++++++++++++++++++++++++++++++ src/router/route-menu.js | 14 ++++++++ 2 files changed, 86 insertions(+) create mode 100644 src/router/index.js create mode 100644 src/router/route-menu.js diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..1bf4788 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,72 @@ +import Vue from 'vue' +import Router from 'vue-router' + +Vue.use(Router) + +const children = [ + { + path: '/node/list', + name: 'node-list', + meta: { title: '节点列表' }, + component: () => import('../pages/node/list') + }, + { + path: '/user/list', + name: 'user-list', + meta: { title: '用户列表' }, + component: () => import('../pages/user') + }, + { + path: '/audit/list', + name: 'audit-list', + meta: { title: '审计日志' }, + component: () => import('@/pages/audit') + }, + { + path: '/repository/package', + name: 'repository-package', + meta: { title: '软件包列表' }, + component: () => import('@/pages/repository/package') + }, + { + path: '/repository/source', + name: 'repository-source', + meta: { title: '软件源模板列表' }, + component: () => import('@/pages/repository/source') + } +] + +const router = new Router({ + mode: 'hash', + routes: [ + { + path: '/login', + name: 'login', + component: () => import('../pages/login') + }, + { + path: '/', + name: 'home', + component: () => import('../pages/layout'), + redirect: '/node/list', + children: children + }, + { + path: '/install', + name: 'install', + component: () => import('../pages/install') + }, + { + path: '*', + name: '404', + component: () => import('../pages/404') + }, + { + path: '/system/ipAccess', + name: 'ipAccess', + component: () => import('../pages/system/ipAccess') + } + ] +}) + +export default router diff --git a/src/router/route-menu.js b/src/router/route-menu.js new file mode 100644 index 0000000..d3e34d8 --- /dev/null +++ b/src/router/route-menu.js @@ -0,0 +1,14 @@ +/** + * 路由菜单 + * key 对应后台接口返回的菜单中的 id + * value 表示该路由的 path + */ +const routeMenuMap = { + 'nodeList': '/node/list', + 'audit': '/audit/list', + 'user': '/user/list', + 'repository_source': '/repository/source', + 'repository_package': '/repository/package' +} + +export default routeMenuMap -- Gitee