前端重构
This commit is contained in:
+66
-164
@@ -1,8 +1,7 @@
|
||||
/**
|
||||
* KRA - 路由配置
|
||||
* 对应 GVA 的路由结构
|
||||
* @name umi 的路由配置
|
||||
* @doc https://umijs.org/docs/guides/routes
|
||||
* 路由在编译时静态配置,菜单从后端动态获取
|
||||
* 菜单显示由 app.tsx 中的 menu.request 控制
|
||||
*/
|
||||
export default [
|
||||
// 用户相关(无布局)
|
||||
@@ -11,7 +10,7 @@ export default [
|
||||
layout: false,
|
||||
routes: [
|
||||
{
|
||||
name: 'login',
|
||||
name: '登录',
|
||||
path: '/user/login',
|
||||
component: './user/login',
|
||||
},
|
||||
@@ -21,10 +20,19 @@ export default [
|
||||
// 数据库初始化(无布局)
|
||||
{
|
||||
path: '/init',
|
||||
name: '初始化',
|
||||
layout: false,
|
||||
component: './init',
|
||||
},
|
||||
|
||||
// 扫码上传(无布局,客户端页面)
|
||||
{
|
||||
path: '/scanUpload',
|
||||
name: '扫码上传',
|
||||
layout: false,
|
||||
component: './example/upload/scanUpload',
|
||||
},
|
||||
|
||||
// 错误页面(无布局)
|
||||
{
|
||||
path: '/error',
|
||||
@@ -37,197 +45,84 @@ export default [
|
||||
],
|
||||
},
|
||||
|
||||
// ========== 以下路由在菜单中由后端控制显示 ==========
|
||||
// 路由必须静态配置,菜单显示由后端 /menu/getMenu 接口控制
|
||||
|
||||
// 仪表盘
|
||||
{
|
||||
path: '/dashboard',
|
||||
name: 'dashboard',
|
||||
icon: 'dashboard',
|
||||
name: '仪表盘',
|
||||
component: './dashboard',
|
||||
hideInMenu: true, // 菜单由后端控制
|
||||
},
|
||||
|
||||
// 超级管理员 - 用户管理
|
||||
// 超级管理员
|
||||
{
|
||||
path: '/admin',
|
||||
name: 'superAdmin',
|
||||
icon: 'crown',
|
||||
access: 'isAdmin',
|
||||
name: '超级管理员',
|
||||
hideInMenu: true,
|
||||
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: '/admin/user', name: '用户管理', component: './system/user' },
|
||||
{ path: '/admin/authority', name: '角色管理', component: './system/authority' },
|
||||
{ path: '/admin/menu', name: '菜单管理', component: './system/menu' },
|
||||
{ path: '/admin/api', name: 'API管理', component: './system/api' },
|
||||
{ path: '/admin/operation', name: '操作历史', component: './system/operation' },
|
||||
{ path: '/admin/dictionary', name: '字典管理', component: './system/dictionary' },
|
||||
{ path: '/admin/dictionary/detail/:id', name: '字典详情', component: './system/dictionary/detail', hideInMenu: true },
|
||||
{ path: '/admin/sysParams', name: '参数管理', component: './system/params' },
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
// 系统工具
|
||||
{
|
||||
path: '/systemTools',
|
||||
name: 'systemTools',
|
||||
icon: 'tool',
|
||||
access: 'isAdmin',
|
||||
name: '系统工具',
|
||||
hideInMenu: true,
|
||||
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: '/systemTools/autoCode', name: '代码生成器', component: './systemTools/autoCode' },
|
||||
{ path: '/systemTools/autoCodeAdmin', name: '自动化代码管理', component: './systemTools/autoCodeAdmin' },
|
||||
{ path: '/systemTools/autoCodeEdit/:id', name: '自动化代码编辑', component: './systemTools/autoCode', hideInMenu: true },
|
||||
{ path: '/systemTools/formCreate', name: '表单生成器', component: './systemTools/formCreate' },
|
||||
{ path: '/systemTools/system', name: '系统配置', component: './systemTools/system' },
|
||||
{ path: '/systemTools/autoPkg', name: '模板配置', component: './systemTools/autoPkg' },
|
||||
{ path: '/systemTools/exportTemplate', name: '导出模板', component: './systemTools/exportTemplate' },
|
||||
{ path: '/systemTools/picture', name: 'AI页面绘制', component: './systemTools/autoCode/picture' },
|
||||
{ path: '/systemTools/mcpTool', name: 'Mcp Tools模板', component: './systemTools/autoCode/mcp' },
|
||||
{ path: '/systemTools/mcpTest', name: 'Mcp Tools测试', component: './systemTools/autoCode/mcpTest' },
|
||||
{ path: '/systemTools/sysVersion', name: '版本管理', component: './systemTools/version' },
|
||||
{ path: '/systemTools/sysError', name: '错误日志', component: './systemTools/sysError' },
|
||||
{ path: '/systemTools/installPlugin', name: '插件安装', component: './systemTools/installPlugin' },
|
||||
{ path: '/systemTools/pubPlug', name: '打包插件', component: './systemTools/pubPlug' },
|
||||
],
|
||||
},
|
||||
|
||||
// 插件
|
||||
{
|
||||
path: '/plugin',
|
||||
name: 'plugin',
|
||||
icon: 'appstore',
|
||||
name: '插件系统',
|
||||
hideInMenu: true,
|
||||
routes: [
|
||||
{
|
||||
path: '/plugin/announcement',
|
||||
name: 'announcement',
|
||||
icon: 'notification',
|
||||
component: './plugin/announcement',
|
||||
},
|
||||
{
|
||||
path: '/plugin/email',
|
||||
name: 'email',
|
||||
icon: 'mail',
|
||||
component: './plugin/email',
|
||||
},
|
||||
{ path: '/plugin/announcement', name: '公告管理', component: './plugin/announcement' },
|
||||
{ path: '/plugin/email', name: '邮件插件', component: './plugin/email' },
|
||||
],
|
||||
},
|
||||
|
||||
// 示例
|
||||
{
|
||||
path: '/example',
|
||||
name: 'example',
|
||||
icon: 'experiment',
|
||||
name: '示例文件',
|
||||
hideInMenu: true,
|
||||
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: '/example/customer', name: '客户列表', component: './example/customer' },
|
||||
{ path: '/example/upload', name: '媒体库', component: './example/upload' },
|
||||
{ path: '/example/breakpoint', name: '断点续传', component: './example/breakpoint' },
|
||||
],
|
||||
},
|
||||
|
||||
// 个人中心
|
||||
{
|
||||
path: '/person',
|
||||
name: 'person',
|
||||
icon: 'user',
|
||||
name: '个人信息',
|
||||
component: './person',
|
||||
hideInMenu: true,
|
||||
},
|
||||
@@ -235,9 +130,17 @@ export default [
|
||||
// 关于
|
||||
{
|
||||
path: '/about',
|
||||
name: 'about',
|
||||
icon: 'info-circle',
|
||||
name: '关于我们',
|
||||
component: './about',
|
||||
hideInMenu: true,
|
||||
},
|
||||
|
||||
// 服务器状态
|
||||
{
|
||||
path: '/state',
|
||||
name: '服务器状态',
|
||||
component: './system/state',
|
||||
hideInMenu: true,
|
||||
},
|
||||
|
||||
// 默认重定向
|
||||
@@ -246,10 +149,9 @@ export default [
|
||||
redirect: '/dashboard',
|
||||
},
|
||||
|
||||
// 404
|
||||
// 404 - 放在最后
|
||||
{
|
||||
path: '*',
|
||||
layout: false,
|
||||
path: '/*',
|
||||
component: './error/404',
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user