From 0d7f5e037e2d61450751f28200c122fb592cd584 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 1 Jun 2020 10:36:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=A5=E4=BE=9D=202.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/router/index.js | 18 +++++++++--------- ruoyi-ui/src/store/modules/permission.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index ec7bc7c0..acebbd0e 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -33,23 +33,23 @@ export const constantRoutes = [ children: [ { path: '/redirect/:path(.*)', - component: () => import('@/views/redirect') + component: (resolve) => require(['@/views/redirect'], resolve) } ] }, { path: '/login', - component: () => import('@/views/login'), + component: (resolve) => require(['@/views/login'], resolve), hidden: true }, { path: '/404', - component: () => import('@/views/error/404'), + component: (resolve) => require(['@/views/error/404'], resolve), hidden: true }, { path: '/401', - component: () => import('@/views/error/401'), + component: (resolve) => require(['@/views/error/401'], resolve), hidden: true }, { @@ -59,7 +59,7 @@ export const constantRoutes = [ children: [ { path: 'index', - component: () => import('@/views/index'), + component: (resolve) => require(['@/views/index'], resolve), name: '首页', meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } } @@ -73,7 +73,7 @@ export const constantRoutes = [ children: [ { path: 'profile', - component: () => import('@/views/system/user/profile/index'), + component: (resolve) => require(['@/views/system/user/profile/index'], resolve), name: 'Profile', meta: { title: '个人中心', icon: 'user' } } @@ -86,7 +86,7 @@ export const constantRoutes = [ children: [ { path: 'type/data/:dictId(\\d+)', - component: () => import('@/views/system/dict/data'), + component: (resolve) => require(['@/views/system/dict/data'], resolve), name: 'Data', meta: { title: '字典数据', icon: '' } } @@ -99,7 +99,7 @@ export const constantRoutes = [ children: [ { path: 'log', - component: () => import('@/views/monitor/job/log'), + component: (resolve) => require(['@/views/monitor/job/log'], resolve), name: 'JobLog', meta: { title: '调度日志' } } @@ -112,7 +112,7 @@ export const constantRoutes = [ children: [ { path: 'edit', - component: () => import('@/views/tool/gen/editTable'), + component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), name: 'GenEdit', meta: { title: '修改生成配置' } } diff --git a/ruoyi-ui/src/store/modules/permission.js b/ruoyi-ui/src/store/modules/permission.js index eb311642..deed4519 100644 --- a/ruoyi-ui/src/store/modules/permission.js +++ b/ruoyi-ui/src/store/modules/permission.js @@ -48,7 +48,7 @@ function filterAsyncRouter(asyncRouterMap) { } export const loadView = (view) => { // 路由懒加载 - return () => import(`@/views/${view}`) + return (resolve) => require([`@/views/${view}`], resolve) } export default permission