From 6e14601c7cd8312a8dcb372b341ea05c7b965a23 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 16 Dec 2021 16:34:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=89=88=E6=9C=AC=E5=B7=AE?= =?UTF-8?q?=E5=BC=82=E5=AF=BC=E8=87=B4=E7=9A=84=E6=87=92=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/package.json | 1 + ruoyi-ui/src/router/index.js | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 600e9ad1..6d33bdf5 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -65,6 +65,7 @@ "@vue/cli-plugin-eslint": "4.4.6", "@vue/cli-service": "4.4.6", "babel-eslint": "10.1.0", + "babel-plugin-dynamic-import-node": "2.3.3", "chalk": "4.1.0", "connect": "3.6.6", "eslint": "7.15.0", diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index ccf886f7..6510ff70 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -35,28 +35,28 @@ export const constantRoutes = [ children: [ { path: '/redirect/:path(.*)', - component: (resolve) => require(['@/views/redirect'], resolve) + component: () => import('@/views/redirect') } ] }, { path: '/login', - component: (resolve) => require(['@/views/login'], resolve), + component: () => import('@/views/login'), hidden: true }, { path: '/register', - component: (resolve) => require(['@/views/register'], resolve), + component: () => import('@/views/register'), hidden: true }, { path: '/404', - component: (resolve) => require(['@/views/error/404'], resolve), + component: () => import('@/views/error/404'), hidden: true }, { path: '/401', - component: (resolve) => require(['@/views/error/401'], resolve), + component: () => import('@/views/error/401'), hidden: true }, { @@ -66,7 +66,7 @@ export const constantRoutes = [ children: [ { path: 'index', - component: (resolve) => require(['@/views/index'], resolve), + component: () => import('@/views/index'), name: 'Index', meta: { title: '首页', icon: 'dashboard', affix: true } } @@ -80,7 +80,7 @@ export const constantRoutes = [ children: [ { path: 'profile', - component: (resolve) => require(['@/views/system/user/profile/index'], resolve), + component: () => import('@/views/system/user/profile/index'), name: 'Profile', meta: { title: '个人中心', icon: 'user' } } @@ -93,7 +93,7 @@ export const constantRoutes = [ children: [ { path: 'role/:userId(\\d+)', - component: (resolve) => require(['@/views/system/user/authRole'], resolve), + component: () => import('@/views/system/user/authRole'), name: 'AuthRole', meta: { title: '分配角色', activeMenu: '/system/user' } } @@ -106,7 +106,7 @@ export const constantRoutes = [ children: [ { path: 'user/:roleId(\\d+)', - component: (resolve) => require(['@/views/system/role/authUser'], resolve), + component: () => import('@/views/system/role/authUser'), name: 'AuthUser', meta: { title: '分配用户', activeMenu: '/system/role' } } @@ -119,7 +119,7 @@ export const constantRoutes = [ children: [ { path: 'index/:dictId(\\d+)', - component: (resolve) => require(['@/views/system/dict/data'], resolve), + component: () => import('@/views/system/dict/data'), name: 'Data', meta: { title: '字典数据', activeMenu: '/system/dict' } } @@ -132,7 +132,7 @@ export const constantRoutes = [ children: [ { path: 'index', - component: (resolve) => require(['@/views/monitor/job/log'], resolve), + component: () => import('@/views/monitor/job/log'), name: 'JobLog', meta: { title: '调度日志', activeMenu: '/monitor/job' } } @@ -145,7 +145,7 @@ export const constantRoutes = [ children: [ { path: 'index', - component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), + component: () => import('@/views/tool/gen/editTable'), name: 'GenEdit', meta: { title: '修改生成配置', activeMenu: '/tool/gen' } }