GET/api/v1/tree获取站点目录树
Try it 面板需要启用 JavaScript。
返回站点目录树,数据来自构建产物 tree.json,与页面侧边栏导航一致。Uri 相对站点根。
Response
Body
| Name | Data Type | Required | Description |
|---|---|---|---|
| title | string | Yes | 节点显示名,已剥离标题标签与扩展名 |
| path | string | Yes | 页面路径,相对站点根(目录节点指向其 index.html) |
| tags | array | Yes | 标题标签小写数组,无标签时为空数组 |
| children | array | Yes | 子节点数组,叶子节点为空数组 |
type TreeNodeDTO = {
/** 节点显示名,已剥离标题标签与扩展名 */
title: string
/** 页面路径,相对站点根(目录节点指向其 index.html) */
path: string
/** 标题标签小写数组,无标签时为空数组 */
tags: string[]
/** 子节点数组,叶子节点为空数组 */
children: Record<string, unknown>[]
}{
"title": "sites",
"path": "cn/api_references/api-v1/sites/index.html",
"tags": [],
"children": [
{
"title": "注册 git 源站点",
"path": "cn/api_references/api-v1/sites/add.html",
"tags": [
"post"
],
"children": []
}
]
}HTTP Code
原始响应,无统一包装,结果仅以 HTTP 状态码表达:
| HTTP Status | Meaning | Notes |
|---|---|---|
| 200 | 成功 | 返回目录树 |
