跳到主要内容

获取角色列表

分页查询当前组织下的角色列表。

请求地址:/openapi/v1/role/list

请求方法:GET

请求参数​

参数类型是否必填说明示例
currentInteger否当前页码,默认 1。1
pageSizeInteger否每页记录数,默认 10。2

如何使用返回结果​

响应中的 data[].roleId 可以直接用于后续角色接口。例如,修改角色名称、修改角色模块权限、查询角色成员、删除角色成员、删除角色 都需要传入 roleId。

请求示例​

{
"current": 1,
"pageSize": 2
}

返回参数​

参数类型说明示例
successBoolean请求是否成功。true
requestIdString请求 ID。Ge0c4YYB-FLLLxWEnIHGs2ZCdIGc1RDE
currentInteger当前页码。1
pageSizeInteger每页记录数。2
totalInteger总记录数。21
dataArray角色列表,包含 roleId、name、type。{ "roleId": "16", "name": "系统管理员", "type": "system" }

角色字段说明​

参数类型说明
roleIdString角色 ID。
nameString角色名称。
typeString角色类型,可选值:system(系统角色)、custom(自定义角色)。

调用成功示例​

{
"success": true,
"requestId": "Ge0c4YYB-FLLLxWEnIHGs2ZCdIGc1RDE",
"current": 1,
"pageSize": 2,
"total": 21,
"data": [
{
"roleId": "16",
"name": "系统管理员",
"type": "system"
},
{
"roleId": "17",
"name": "普通成员",
"type": "custom"
}
]
}