refactor: 分页响应数据结构调整
This commit is contained in:
@@ -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),
|
||||
})),
|
||||
|
||||
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user