简要描述
请求url
- https://www.商城域名.com/index.php?s=/api/category/list
请求方式
是否需授权登录
请求header
| 参数名 | 类型 | 是否必须 | 示例值 | 说明 | 
| storeId | int | 必填 | 10001 | 商城ID | 
| platform | string | 必填 | H5 | 当前请求的客户端(APP、小程序、H5等) | 
| Access-Token | string | 选填 | - | 当前登录用户的 Token | 
返回示例
{
  "status": 200,
  "message": "success",
  "data": {
    "list": [
      {
        "category_id": 10001,
        "name": "手机数码",
        "parent_id": 0,
        "image_id": 10185,
        "status": 1,
        "sort": 50,
        "children": [
          {
            "category_id": 10010,
            "name": "小米",
            "parent_id": 10001,
            "image_id": 10001,
            "status": 1,
            "sort": 90,
            "image": {
              "file_id": 10001,
              "file_type": 10,
              "preview_url": "http://static.yoshop.xany6.com/201807171021031720f9679.png",
              "external_url": "http://static.yoshop.xany6.com/201807171021031720f9679.png"
            }
          },
          {
            "category_id": 10011,
            "name": "华为",
            "parent_id": 10001,
            "image_id": 10002,
            "status": 1,
            "sort": 92,
            "image": {
              "file_id": 10002,
              "file_type": 10,
              "preview_url": "http://static.yoshop.xany6.com/20180717102129b4e214214.jpg",
              "external_url": "http://static.yoshop.xany6.com/20180717102129b4e214214.jpg"
            }
          }
        ],
        "image": {
          "file_id": 10185,
          "file_type": 10,
          "preview_url": "http://static.yoshop.xany6.com/201809281707400fb788198.png",
          "external_url": "http://static.yoshop.xany6.com/201809281707400fb788198.png"
        }
      }
    ]
  }
}
返回参数
| 参数名 | 类型 | 示例值 | 说明 | 
| status | int | 200 | 请求状态(200:请求成功;500:请求错误/失败) | 
| message | string | success | 请求结果的信息,默认为 success | 
| data | object | - | 返回的业务数据 | 
data 参数
| 参数名 | 类型 | 示例值 | 说明 | 
| list | array | - | 列表数据 | 
data.list 参数
| 参数名 | 类型 | 示例值 | 说明 | 
| category_id | int | 10001 | 分类ID | 
| name | string | 手机数码 | 分类名称 | 
| parent_id | int | - | 父级分类ID | 
| image_id | int | 10185 | 分类图片ID | 
| status | int | 1 | 分类状态(1显示 0隐藏) | 
| sort | int | 50 | 排序 (数字越小越靠前) | 
| children | array | - | 子分类列表 | 
| image | object | - | 分类图片信息 | 
data.list.image 参数
| 参数名 | 类型 | 示例值 | 说明 | 
| file_id | int | 10185 | 文件ID | 
| file_type | int | 10 | 文件类型(10图片 20附件 30视频) | 
| preview_url | string | 201809281707400fb788198.png | 图片预览地址 |