跳到主要内容

获取角色信息

分页查询 NineData 系统中已创建的角色列表,支持获取角色 ID、名称和类型。

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

请求方法:GET

请求参数

参数类型是否必选说明示例
currentInteger当前页码,从 1 开始,默认 1。1
pageSizeInteger每页大小,默认 10。10

返回参数

参数类型说明示例
successBoolean请求是否成功。true
dataArray角色列表,包含如下字段:
  • roleId:角色 ID。
  • name:角色名称。
  • type:角色类型。
    可选值:
    • system:系统管理员。
    • custom:普通角色。
{
"roleId": "16",
"name": "系统管理员",
"type": "system"
}
currentInteger当前页码。1
pageSizeInteger每页大小。10
totalInteger总记录数。2

调用成功示例

{
"success": true,
"requestId": "Uz2t8YEJ-JPNMyCXnOLQk1DUdQKq3VFS",
"data": [{
"roleId": "16",
"name": "系统管理员",
"type": "system"
}, {
"roleId": "17",
"name": "普通成员",
"type": "custom"
}, {
"roleId": "40",
"name": "生产环境管理员",
"type": "custom"
}, {
"roleId": "41",
"name": "生产环境只读",
"type": "custom"
}, {
"roleId": "42",
"name": "开发环境管理员",
"type": "custom"
}, {
"roleId": "160",
"name": "开发角色",
"type": "custom"
}, {
"roleId": "1259",
"name": "A业务-DBA",
"type": "custom"
}, {
"roleId": "1260",
"name": "安全审计员",
"type": "custom"
}, {
"roleId": "1261",
"name": "测试角色权限",
"type": "custom"
}, {
"roleId": "1371",
"name": "测试角色_new",
"type": "custom"
}],
"current": 1,
"pageSize": 10,
"total": 16
}