{
  "tags": [
    "公共接口"
  ],
  "description": "根据当前登录账号类型返回新版面板的侧边栏和顶部菜单。管理员与普通用户使用不同的侧边栏集合，但顶部菜单固定包含首页和日志入口。侧边栏节点使用 path、title、header、icon、children 和可选 auth；其中 auth 为 [\"hidden\"] 时表示该路由不在菜单中直接展示。该接口需要登录。",
  "operationId": "user_get_v1_common_menu2",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "业务结果通过 HTTP 200 返回。认证成功时返回 sider 和 header 菜单数组；认证失效时返回业务错误码。",
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "integer",
                    "enum": [
                      0
                    ],
                    "description": "成功状态码，菜单读取成功时固定为 0。"
                  },
                  "msg": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "菜单读取成功时固定为空字符串。"
                  },
                  "data": {
                    "type": "object",
                    "required": [
                      "sider",
                      "header"
                    ],
                    "properties": {
                      "sider": {
                        "type": "array",
                        "description": "侧边栏菜单节点数组。",
                        "items": {
                          "type": "object",
                          "required": [
                            "path",
                            "title",
                            "header",
                            "icon"
                          ],
                          "properties": {
                            "path": {
                              "type": "string",
                              "description": "前端页面路由，例如 /dashboard/site 或 /site/list。"
                            },
                            "title": {
                              "type": "string",
                              "description": "该侧边栏菜单项在面板中的显示名称。"
                            },
                            "header": {
                              "type": "string",
                              "description": "该菜单所属顶部导航标识，例如 home 或 system。"
                            },
                            "icon": {
                              "type": "string",
                              "description": "该侧边栏菜单项使用的前端图标名称。"
                            },
                            "auth": {
                              "type": "array",
                              "description": "可选的菜单展示控制标记；当前服务端中 [\"hidden\"] 表示隐藏该路由菜单项。",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "hidden"
                                ]
                              }
                            },
                            "children": {
                              "type": "array",
                              "description": "可选的子菜单列表；子节点使用与父节点相同的 path、title 和可选 auth 字段。",
                              "items": {
                                "type": "object",
                                "required": [
                                  "path",
                                  "title"
                                ],
                                "properties": {
                                  "path": {
                                    "type": "string",
                                    "description": "子菜单对应的前端页面路由。"
                                  },
                                  "title": {
                                    "type": "string",
                                    "description": "该子菜单项在面板中的显示名称。"
                                  },
                                  "auth": {
                                    "type": "array",
                                    "description": "可选的菜单展示控制标记。",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "hidden"
                                      ]
                                    }
                                  }
                                },
                                "additionalProperties": false,
                                "description": "新版面板侧边栏子菜单节点。"
                              }
                            }
                          },
                          "additionalProperties": false,
                          "description": "新版面板侧边栏菜单节点。"
                        }
                      },
                      "header": {
                        "type": "array",
                        "description": "顶部菜单节点数组。",
                        "items": {
                          "type": "object",
                          "properties": {
                            "path": {
                              "type": "string",
                              "description": "前端页面路由；服务端固定返回 /dashboard/ 或 /log。"
                            },
                            "title": {
                              "type": "string",
                              "description": "顶部菜单显示标题；服务端固定为首页或日志。"
                            },
                            "icon": {
                              "type": "string",
                              "description": "顶部菜单图标名称。"
                            },
                            "hideSider": {
                              "type": "boolean",
                              "description": "进入该顶部页面后是否隐藏左侧菜单栏。"
                            },
                            "name": {
                              "type": "string",
                              "description": "顶部菜单内部标识；服务端固定为 home 或 system。"
                            }
                          },
                          "additionalProperties": false,
                          "description": "新版面板顶部菜单节点。"
                        }
                      }
                    },
                    "additionalProperties": false,
                    "description": "新版面板菜单集合。"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "login_required"
                    ],
                    "description": "login_required 表示认证无效。"
                  },
                  "msg": {
                    "type": "string",
                    "description": "认证失败原因。 具体说明"
                  },
                  "data": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "业务错误时固定为空字符串。"
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "example": {
            "code": 0,
            "msg": "",
            "data": {
              "sider": [
                {
                  "path": "/dashboard/node",
                  "title": "节点管理",
                  "header": "home",
                  "icon": "logo-buffer",
                  "children": [
                    {
                      "path": "/node/list",
                      "title": "节点列表"
                    }
                  ]
                }
              ],
              "header": [
                {
                  "path": "/dashboard/",
                  "title": "首页",
                  "icon": "md-home",
                  "hideSider": false,
                  "name": "home"
                }
              ]
            }
          }
        }
      }
    }
  },
  "x-python-handler": "common.MenuAPI2",
  "x-python-route-line": 1078,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "common.MenuAPI2"
    },
    {
      "key": "x-python-route-line",
      "value": 1078
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "get",
  "path": "/v1/common/menu2",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "AccessToken": {
      "type": "apiKey",
      "in": "header",
      "name": "access-token",
      "description": "通过登录接口获得的短期访问令牌。"
    },
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "api-key",
      "description": "API Key；必须和 api-secret 同时发送。"
    },
    "ApiSecret": {
      "type": "apiKey",
      "in": "header",
      "name": "api-secret",
      "description": "API Secret；必须和 api-key 同时发送。"
    }
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "获取新版面板菜单",
    "description": {
      "content": "根据当前登录账号类型返回新版面板的侧边栏和顶部菜单。管理员与普通用户使用不同的侧边栏集合，但顶部菜单固定包含首页和日志入口。侧边栏节点使用 path、title、header、icon、children 和可选 auth；其中 auth 为 [\"hidden\"] 时表示该路由不在菜单中直接展示。该接口需要登录。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "common",
        "menu2"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": []
    },
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "GET",
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}