Skip to content

组织树

返回组织部门树,仅含部门节点,以递归嵌套结构表示层级关系。

项目 内容
请求方式 GET
接口地址 https://devapi.fengshengshou.com/api/organization/tree
鉴权 是,需在请求头中携带 Token

本接口无请求参数。

Terminal window
curl -X GET "https://devapi.fengshengshou.com/api/organization/tree" \
-H "Authorization: Bearer your_token_here"
字段 类型 说明
code int 状态码,0 表示成功
message string 响应描述
data array 部门节点数组(顶层部门列表)
data[].id int 部门 ID
data[].name string 部门名称
data[].type string 节点类型,固定值 department
data[].children array 子部门数组,结构与父节点相同,无子部门时为空数组
{
"code": 0,
"message": "success",
"data": [
{
"id": 1,
"name": "总公司",
"type": "department",
"children": [
{
"id": 2,
"name": "技术部",
"type": "department",
"children": [
{
"id": 5,
"name": "前端组",
"type": "department",
"children": []
}
]
},
{
"id": 3,
"name": "市场部",
"type": "department",
"children": []
}
]
}
]
}
{
"code": 401,
"message": "未登录或 Token 已过期",
"data": null
}