// 模拟后端动态生成路由 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: "/isv", meta: { title: "ISV管理", icon: "ri:shield-user-line", rank: 10 }, children: [ { path: "/isv/list/index", name: "IsvManage", meta: { title: "ISV列表", 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 }; } } ]);