获取导航列表接口

API 调用地址

{域名地址}/nav/list

说明:{域名地址} 需要替换成你的域名地址,如 https://www.anqicms.com/api/nav/list

调用方法

GET

请求参数

字段名 类型 必填 说明
typeId int 导航类型,默认:1

返回参数

字段名 类型 说明
code int 错误码
msg string 错误原因说明
data object[] 结果内容
data 结果 item 信息
字段名 类型 说明
id int 导航 ID
title string 导航名称
sub_title string 导航二级标题
description string 导航文字描述
parent_id int 上级导航 ID
type_id int 导航类型
nav_type int 导航链接类型
page_id int 导航链接值
link string 导航链接
created_time int 添加时间
updated_time int 更新时间

请求数据示例

参数
typeId 1

返回数据示例

{
  "code": 0,
  "data": [
    {
      "id": 1,
      "created_time": 1611236423,
      "updated_time": 1611236430,
      "title": "博客首页",
      "sub_title": "",
      "description": "",
      "parent_id": 0,
      "nav_type": 0,
      "page_id": 0,
      "type_id": 1,
      "link": "https://www.anqicms.com/",
      "sort": 0,
      "status": 1,
      "nav_list": null
    },
    {
      "id": 4,
      "created_time": 1611236495,
      "updated_time": 1625291595,
      "title": "小程序实战开发",
      "sub_title": "",
      "description": "",
      "parent_id": 0,
      "nav_type": 1,
      "page_id": 3,
      "type_id": 1,
      "link": "https://www.anqicms.com/program",
      "sort": 5,
      "status": 1,
      "nav_list": [
        {
          "id": 7,
          "created_time": 1611795528,
          "updated_time": 1611795640,
          "title": "微信小程序开发",
          "sub_title": "",
          "description": "",
          "parent_id": 4,
          "nav_type": 1,
          "page_id": 5,
          "type_id": 1,
          "link": "https://www.anqicms.com/weapp",
          "sort": 1,
          "status": 1,
          "nav_list": null
        }
      ]
    }
  ],
  "msg": ""
}

错误代码

错误码 说明
0 OK
-1 错误,错误原因在 msg 中指出
1001 未登录
1002 未授权
200 API 请求 OK