From da5c1328beb06a4c785aa2791a2b9ca3bbeefaa6 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 21 Apr 2020 14:48:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B7=AF=E7=94=B1=E6=87=92?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=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/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 ec7bc7c..acebbd0 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 eb31164..deed451 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