mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
38 lines
632 B
TypeScript
38 lines
632 B
TypeScript
// 模拟后端动态生成路由
|
|
import { defineFakeRoute } from "vite-plugin-fake-server/client";
|
|
|
|
/**
|
|
* 服务管理
|
|
*/
|
|
const apiRouter = {
|
|
path: "/serviceManage",
|
|
meta: {
|
|
title: "服务管理",
|
|
icon: "ri:server-line",
|
|
rank: 10
|
|
},
|
|
children: [
|
|
{
|
|
path: "/serviceManage/apiManage/index",
|
|
name: "ApiManage",
|
|
meta: {
|
|
title: "接口管理",
|
|
roles: ["admin"]
|
|
}
|
|
}
|
|
]
|
|
};
|
|
|
|
export default defineFakeRoute([
|
|
{
|
|
url: "/get-async-routes",
|
|
method: "get",
|
|
response: () => {
|
|
return {
|
|
success: true,
|
|
data: [apiRouter]
|
|
};
|
|
}
|
|
}
|
|
]);
|