mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-12 07:02:14 +08:00
109 lines
1.9 KiB
TypeScript
109 lines
1.9 KiB
TypeScript
// 模拟后端动态生成路由
|
|
import { defineFakeRoute } from "vite-plugin-fake-server/client";
|
|
|
|
const apiRouters = [
|
|
{
|
|
path: "/serve",
|
|
meta: {
|
|
title: "服务管理",
|
|
icon: "ri:server-line",
|
|
rank: 10
|
|
},
|
|
children: [
|
|
{
|
|
path: "/serve/api/index",
|
|
name: "ApiManage",
|
|
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/index",
|
|
name: "IsvManage",
|
|
meta: {
|
|
title: "ISV列表",
|
|
roles: ["admin"]
|
|
}
|
|
},
|
|
{
|
|
path: "/isv/perm/permGroup",
|
|
name: "PermGroup",
|
|
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"]
|
|
// }
|
|
// }
|
|
// ]
|
|
// }
|
|
];
|
|
|
|
export default defineFakeRoute([
|
|
{
|
|
url: "/get-async-routes",
|
|
method: "get",
|
|
response: () => {
|
|
return {
|
|
success: true,
|
|
data: apiRouters
|
|
};
|
|
}
|
|
}
|
|
]);
|