Skip to content

岗位树

GET /api/admin/post/tree
权限 admin

无请求参数。

响应

数组格式,每个节点结构:

字段类型说明
typestring节点类型:group-分组、post-岗位
idnumber分组 ID 或岗位 ID(由 type 区分)
namestring显示名称
nodesarray子节点

响应示例

json
[
  {
    "type": "group",
    "id": 1,
    "name": "技术岗",
    "nodes": [
      {
        "type": "post",
        "id": 101,
        "name": "Java开发",
        "nodes": []
      }
    ]
  }
]

异常

错误码HTTP说明
MENU_PERMISSION_DENIED403权限不足,需 admin 权限