256 lines
5.2 KiB
TypeScript
256 lines
5.2 KiB
TypeScript
/**
|
|
* KRA - 路由配置
|
|
* 对应 GVA 的路由结构
|
|
* @name umi 的路由配置
|
|
* @doc https://umijs.org/docs/guides/routes
|
|
*/
|
|
export default [
|
|
// 用户相关(无布局)
|
|
{
|
|
path: '/user',
|
|
layout: false,
|
|
routes: [
|
|
{
|
|
name: 'login',
|
|
path: '/user/login',
|
|
component: './user/login',
|
|
},
|
|
],
|
|
},
|
|
|
|
// 数据库初始化(无布局)
|
|
{
|
|
path: '/init',
|
|
layout: false,
|
|
component: './init',
|
|
},
|
|
|
|
// 错误页面(无布局)
|
|
{
|
|
path: '/error',
|
|
layout: false,
|
|
routes: [
|
|
{ path: '/error/403', component: './error/403' },
|
|
{ path: '/error/404', component: './error/404' },
|
|
{ path: '/error/500', component: './error/500' },
|
|
{ path: '/error/reload', component: './error/reload' },
|
|
],
|
|
},
|
|
|
|
// 仪表盘
|
|
{
|
|
path: '/dashboard',
|
|
name: 'dashboard',
|
|
icon: 'dashboard',
|
|
component: './dashboard',
|
|
},
|
|
|
|
// 超级管理员 - 用户管理
|
|
{
|
|
path: '/admin',
|
|
name: 'superAdmin',
|
|
icon: 'crown',
|
|
access: 'isAdmin',
|
|
routes: [
|
|
{
|
|
path: '/admin/user',
|
|
name: 'user',
|
|
icon: 'user',
|
|
component: './system/user',
|
|
},
|
|
{
|
|
path: '/admin/authority',
|
|
name: 'authority',
|
|
icon: 'team',
|
|
component: './system/authority',
|
|
},
|
|
{
|
|
path: '/admin/menu',
|
|
name: 'menu',
|
|
icon: 'menu',
|
|
component: './system/menu',
|
|
},
|
|
{
|
|
path: '/admin/api',
|
|
name: 'api',
|
|
icon: 'api',
|
|
component: './system/api',
|
|
},
|
|
{
|
|
path: '/admin/operation',
|
|
name: 'operation',
|
|
icon: 'fileSearch',
|
|
component: './system/operation',
|
|
},
|
|
{
|
|
path: '/admin/dictionary',
|
|
name: 'dictionary',
|
|
icon: 'book',
|
|
component: './system/dictionary',
|
|
},
|
|
{
|
|
path: '/admin/dictionary/detail/:id',
|
|
name: 'dictionaryDetail',
|
|
component: './system/dictionary/detail',
|
|
hideInMenu: true,
|
|
},
|
|
{
|
|
path: '/admin/params',
|
|
name: 'params',
|
|
icon: 'setting',
|
|
component: './system/params',
|
|
},
|
|
],
|
|
},
|
|
|
|
|
|
// 系统工具
|
|
{
|
|
path: '/systemTools',
|
|
name: 'systemTools',
|
|
icon: 'tool',
|
|
access: 'isAdmin',
|
|
routes: [
|
|
{
|
|
path: '/systemTools/system',
|
|
name: 'system',
|
|
icon: 'setting',
|
|
component: './systemTools/system',
|
|
},
|
|
{
|
|
path: '/systemTools/version',
|
|
name: 'version',
|
|
icon: 'info-circle',
|
|
component: './systemTools/version',
|
|
},
|
|
{
|
|
path: '/systemTools/sysError',
|
|
name: 'sysError',
|
|
icon: 'warning',
|
|
component: './systemTools/sysError',
|
|
},
|
|
{
|
|
path: '/systemTools/autoCode',
|
|
name: 'autoCode',
|
|
icon: 'code',
|
|
component: './systemTools/autoCode',
|
|
},
|
|
{
|
|
path: '/systemTools/autoCodeAdmin',
|
|
name: 'autoCodeAdmin',
|
|
icon: 'database',
|
|
component: './systemTools/autoCodeAdmin',
|
|
},
|
|
{
|
|
path: '/systemTools/exportTemplate',
|
|
name: 'exportTemplate',
|
|
icon: 'export',
|
|
component: './systemTools/exportTemplate',
|
|
},
|
|
{
|
|
path: '/systemTools/formCreate',
|
|
name: 'formCreate',
|
|
icon: 'form',
|
|
component: './systemTools/formCreate',
|
|
},
|
|
{
|
|
path: '/systemTools/installPlugin',
|
|
name: 'installPlugin',
|
|
icon: 'appstore-add',
|
|
component: './systemTools/installPlugin',
|
|
},
|
|
{
|
|
path: '/systemTools/pubPlug',
|
|
name: 'pubPlug',
|
|
icon: 'cloud-upload',
|
|
component: './systemTools/pubPlug',
|
|
},
|
|
],
|
|
},
|
|
|
|
// 插件
|
|
{
|
|
path: '/plugin',
|
|
name: 'plugin',
|
|
icon: 'appstore',
|
|
routes: [
|
|
{
|
|
path: '/plugin/announcement',
|
|
name: 'announcement',
|
|
icon: 'notification',
|
|
component: './plugin/announcement',
|
|
},
|
|
{
|
|
path: '/plugin/email',
|
|
name: 'email',
|
|
icon: 'mail',
|
|
component: './plugin/email',
|
|
},
|
|
],
|
|
},
|
|
|
|
// 示例
|
|
{
|
|
path: '/example',
|
|
name: 'example',
|
|
icon: 'experiment',
|
|
routes: [
|
|
{
|
|
path: '/example/customer',
|
|
name: 'customer',
|
|
icon: 'contacts',
|
|
component: './example/customer',
|
|
},
|
|
{
|
|
path: '/example/upload',
|
|
name: 'upload',
|
|
icon: 'upload',
|
|
component: './example/upload',
|
|
},
|
|
{
|
|
path: '/example/upload/scan',
|
|
name: 'scanUpload',
|
|
icon: 'scan',
|
|
component: './example/upload/scanUpload',
|
|
hideInMenu: true,
|
|
},
|
|
{
|
|
path: '/example/breakpoint',
|
|
name: 'breakpoint',
|
|
icon: 'cloud-upload',
|
|
component: './example/breakpoint',
|
|
},
|
|
],
|
|
},
|
|
|
|
// 个人中心
|
|
{
|
|
path: '/person',
|
|
name: 'person',
|
|
icon: 'user',
|
|
component: './person',
|
|
hideInMenu: true,
|
|
},
|
|
|
|
// 关于
|
|
{
|
|
path: '/about',
|
|
name: 'about',
|
|
icon: 'info-circle',
|
|
component: './about',
|
|
},
|
|
|
|
// 默认重定向
|
|
{
|
|
path: '/',
|
|
redirect: '/dashboard',
|
|
},
|
|
|
|
// 404
|
|
{
|
|
path: '*',
|
|
layout: false,
|
|
component: './error/404',
|
|
},
|
|
];
|