24 lines
1.1 KiB
JavaScript
24 lines
1.1 KiB
JavaScript
function load(component){
|
|
return resolve => require([`views/${component}`],resolve);
|
|
}
|
|
|
|
const routes = [
|
|
{ path: '/', redirect: { path: '/home' } },
|
|
{ path: '/login', name: 'Login', component: load('auth/login'), meta: { title: '登录' } },
|
|
{
|
|
path: '/layout', name: 'Layout', component: load('layout/index'), meta: {auth:true},
|
|
children: [
|
|
{ path: '/home', name: 'Home', component: load('home/index'), meta: { title: '首页' } },
|
|
{ path: '/permissions', name: 'Permissions', component: load('system/permissions/index'), meta: { title: '权限管理' } },
|
|
{ path: '/roles', name: 'Roles', component: load('user/roles/index'), meta: { title: '角色管理' } },
|
|
{ path: '/logs', name: 'Logs', component: load('system/logs/index'), meta: { title: '日志管理' } },
|
|
{ path: '/accounts', name: 'Accounts', component: load('user/accounts/index'), meta: { title: '账号管理' } },
|
|
{ path: '/iframe', name: 'Iframe', component: load('iframe/index'), meta: { title: 'iframe' } }
|
|
|
|
]
|
|
},
|
|
{ path: '*', redirect: { path: '/home' } },
|
|
];
|
|
|
|
export default routes;
|