mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-12 07:02:14 +08:00
5.0
This commit is contained in:
37
sop-admin/sop-admin-frontend/mock/asyncRoutes.ts
Normal file
37
sop-admin/sop-admin-frontend/mock/asyncRoutes.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
// 模拟后端动态生成路由
|
||||
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]
|
||||
};
|
||||
}
|
||||
}
|
||||
]);
|
Reference in New Issue
Block a user