feat: 完成创建角色功能

This commit is contained in:
siujamo
2025-12-26 16:00:40 +08:00
parent 9139d0c451
commit 8aaad677b6
8 changed files with 185 additions and 16 deletions
+5
View File
@@ -1,6 +1,7 @@
import type { QueryRoleRequest } from "@/types/web/request"
import webClient from "@/service/web-client"
import type { PageResponse, RoleResponse } from "@/types/web/response"
import type { RoleFormValues } from "@/components/role-display-form"
export async function fetchRoles(
request: QueryRoleRequest | null
@@ -24,3 +25,7 @@ export async function fetchRoles(
const { data } = await webClient.get<RoleResponse>(`/roles?${params.toString()}`)
return data
}
export async function addRole(request: RoleFormValues) {
return await webClient.post("/roles", request)
}