refactor: 分页响应数据结构调整

This commit is contained in:
Ray.Hao
2026-02-12 21:01:48 +08:00
parent c09ce3e4a8
commit 9480b426dc
45 changed files with 1013 additions and 1026 deletions

View File

@@ -94,9 +94,9 @@ const DictAPI = {
url: `${DICT_BASE_URL}/${dictCode}/items`,
method: "get",
params: queryParams,
}).then((res) => ({
...res,
data: (res.data ?? []).map((item) => ({
}).then((data) => ({
...data,
list: (data.list ?? []).map((item) => ({
...item,
tagType: decodeDictTagType((item as any).tagType),
})),

View File

@@ -18,7 +18,7 @@ const RoleAPI = {
},
/** 获取角色的菜单ID集合 */
getRoleMenuIds(roleId: string) {
return request<any, string[]>({ url: `${ROLE_BASE_URL}/${roleId}/menuIds`, method: "get" });
return request<any, string[]>({ url: `${ROLE_BASE_URL}/${roleId}/menu-ids`, method: "get" });
},
/** 分配菜单权限 */
updateRoleMenus(roleId: string, data: number[]) {
@@ -28,6 +28,10 @@ const RoleAPI = {
getFormData(id: string) {
return request<any, RoleForm>({ url: `${ROLE_BASE_URL}/${id}/form`, method: "get" });
},
/** 获取角色的部门ID集合(自定义数据权限) */
getRoleDeptIds(roleId: string) {
return request<any, number[]>({ url: `${ROLE_BASE_URL}/${roleId}/dept-ids`, method: "get" });
},
/** 新增角色 */
create(data: RoleForm) {
return request({ url: `${ROLE_BASE_URL}`, method: "post", data });