wireguard-dashboard-admin/mock/asyncRoutes.ts
2024-05-18 01:11:46 +08:00

53 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 模拟后端动态生成路由
import { defineFakeRoute } from "vite-plugin-fake-server/client";
/**
* roles页面级别权限这里模拟二种 "user"、"common"
* user管理员角色
* common普通角色
*/
const permissionRouter = {
path: "/permission",
meta: {
title: "权限管理",
icon: "ep:lollipop",
rank: 10
},
children: [
{
path: "/permission/page/index",
name: "PermissionPage",
meta: {
title: "页面权限",
roles: ["user", "common"]
}
},
{
path: "/permission/button/index",
name: "PermissionButton",
meta: {
title: "按钮权限",
roles: ["user", "common"],
auths: [
"permission:btn:add",
"permission:btn:edit",
"permission:btn:delete"
]
}
}
]
};
export default defineFakeRoute([
{
url: "/get-async-routes",
method: "get",
response: () => {
return {
success: true,
data: [permissionRouter]
};
}
}
]);