mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
157 lines
2.8 KiB
TypeScript
157 lines
2.8 KiB
TypeScript
// 模拟后端动态生成路由
|
|
import { defineFakeRoute } from "vite-plugin-fake-server/client";
|
|
import { system } from "@/router/enums";
|
|
|
|
const apiRouters = [
|
|
{
|
|
path: "/serve",
|
|
meta: {
|
|
title: "服务管理",
|
|
icon: "ri:server-line",
|
|
rank: 10
|
|
},
|
|
children: [
|
|
{
|
|
path: "/serve/api",
|
|
name: "ServeApi",
|
|
meta: {
|
|
title: "接口管理",
|
|
roles: ["admin"]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: "/doc",
|
|
meta: {
|
|
title: "文档管理",
|
|
icon: "ep:document",
|
|
rank: 10
|
|
},
|
|
children: [
|
|
{
|
|
path: "/doc/setting",
|
|
name: "DocSetting",
|
|
meta: {
|
|
title: "基础配置",
|
|
roles: ["admin"]
|
|
}
|
|
},
|
|
{
|
|
path: "/doc/list",
|
|
name: "DocList",
|
|
meta: {
|
|
title: "文档列表",
|
|
roles: ["admin"]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: "/isv",
|
|
meta: {
|
|
title: "ISV管理",
|
|
icon: "ri:shield-user-line",
|
|
rank: 10
|
|
},
|
|
children: [
|
|
{
|
|
path: "/isv/list",
|
|
name: "IsvList",
|
|
meta: {
|
|
title: "ISV列表",
|
|
roles: ["admin"]
|
|
}
|
|
},
|
|
{
|
|
path: "/isv/perm/permGroup",
|
|
name: "IsvPermPermGroup",
|
|
meta: {
|
|
title: "分组管理",
|
|
roles: ["admin"]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
|
|
// ,
|
|
// {
|
|
// path: "/sys",
|
|
// meta: {
|
|
// title: "系统管理",
|
|
// icon: "ri:settings-2-line",
|
|
// rank: 10
|
|
// },
|
|
// children: [
|
|
// {
|
|
// path: "/admin/user/index",
|
|
// name: "AdminUser",
|
|
// meta: {
|
|
// title: "用户管理",
|
|
// roles: ["admin"]
|
|
// }
|
|
// }
|
|
// ]
|
|
// }
|
|
];
|
|
|
|
const systemManagementRouter = {
|
|
path: "/system",
|
|
meta: {
|
|
icon: "ri:settings-3-line",
|
|
title: "menus.pureSysManagement",
|
|
rank: system
|
|
},
|
|
children: [
|
|
{
|
|
path: "/system/user/index",
|
|
name: "SystemUser",
|
|
meta: {
|
|
icon: "ri:admin-line",
|
|
title: "menus.pureUser",
|
|
roles: ["admin"]
|
|
}
|
|
},
|
|
{
|
|
path: "/system/role/index",
|
|
name: "SystemRole",
|
|
meta: {
|
|
icon: "ri:admin-fill",
|
|
title: "menus.pureRole",
|
|
roles: ["admin"]
|
|
}
|
|
},
|
|
{
|
|
path: "/system/menu/index",
|
|
name: "SystemMenu",
|
|
meta: {
|
|
icon: "ep:menu",
|
|
title: "menus.pureSystemMenu",
|
|
roles: ["admin"]
|
|
}
|
|
},
|
|
{
|
|
path: "/system/dept/index",
|
|
name: "SystemDept",
|
|
meta: {
|
|
icon: "ri:git-branch-line",
|
|
title: "menus.pureDept",
|
|
roles: ["admin"]
|
|
}
|
|
}
|
|
]
|
|
};
|
|
|
|
export default defineFakeRoute([
|
|
{
|
|
url: "/get-async-routes",
|
|
method: "get",
|
|
response: () => {
|
|
return {
|
|
success: true,
|
|
data: apiRouters.concat(systemManagementRouter)
|
|
};
|
|
}
|
|
}
|
|
]);
|