itecdn 5.x用户文档
itecdn 5.x / 用户 API

获取站点系统配置

GET/v1/site-sys-config

读取全局 OpenResty 配置中供站点使用的默认临时白名单时长和封禁时长。接口要求登录,不区分普通用户与管理员。

身份认证

access-token

api-key + api-secret

认证定义
{
  "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 同时发送。"
  }
}

请求参数

未定义路径、查询或请求头参数。

响应

HTTP 200

成功或未登录均返回 HTTP 200。成功时 msg 为 null。

application/json

oneOf

oneOf · 1 · object
字段类型必填说明与约束
codeinteger必填

业务状态码;0 表示成功。

约束 / 默认值 / 示例
{
  "enum": [
    0
  ]
}
msgstring必填

成功时固定为 null。

约束 / 默认值 / 示例
{
  "nullable": true
}
dataobject必填

网站 CC 防护的默认白名单与封禁时间配置。

约束 / 默认值 / 示例
{
  "required": [
    "white_time",
    "block_time"
  ],
  "additionalProperties": false
}
展开字段结构

网站 CC 防护的默认白名单与封禁时间配置。

字段类型必填说明与约束
white_timeinteger必填

默认临时白名单时长,单位为秒。

约束 / 默认值 / 示例
{
  "example": 21600
}
block_timeinteger必填

默认封禁时长,单位为秒。

约束 / 默认值 / 示例
{
  "example": 3600
}
oneOf · 2 · object
字段类型必填说明与约束
codestring必填

未登录时的业务错误码。

约束 / 默认值 / 示例
{
  "enum": [
    "login_required"
  ]
}
msgstring必填

认证失败原因。

datastring必填

错误响应中的固定空字符串。

约束 / 默认值 / 示例
{
  "enum": [
    ""
  ]
}
完整 Schema
{
  "oneOf": [
    {
      "type": "object",
      "required": [
        "code",
        "msg",
        "data"
      ],
      "properties": {
        "code": {
          "type": "integer",
          "enum": [
            0
          ],
          "description": "业务状态码;0 表示成功。"
        },
        "msg": {
          "type": "string",
          "nullable": true,
          "description": "成功时固定为 null。"
        },
        "data": {
          "type": "object",
          "description": "网站 CC 防护的默认白名单与封禁时间配置。",
          "required": [
            "white_time",
            "block_time"
          ],
          "properties": {
            "white_time": {
              "type": "integer",
              "description": "默认临时白名单时长,单位为秒。",
              "example": 21600
            },
            "block_time": {
              "type": "integer",
              "description": "默认封禁时长,单位为秒。",
              "example": 3600
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    {
      "type": "object",
      "required": [
        "code",
        "msg",
        "data"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "login_required"
          ],
          "description": "未登录时的业务错误码。"
        },
        "msg": {
          "type": "string",
          "description": "认证失败原因。"
        },
        "data": {
          "type": "string",
          "enum": [
            ""
          ],
          "description": "错误响应中的固定空字符串。"
        }
      },
      "additionalProperties": false
    }
  ]
}

示例

{
  "code": 0,
  "msg": null,
  "data": {
    "white_time": 21600,
    "block_time": 3600
  }
}

查询成功

{
  "code": 0,
  "msg": null,
  "data": {
    "white_time": 21600,
    "block_time": 3600
  }
}

cURL 示例

根据文档生成;请替换主控地址、路径参数和凭证,并按上表补充查询参数。

curl --request GET \
  "https://master.example.invalid/v1/site-sys-config" \
  --header "access-token: YOUR_ACCESS_TOKEN"

查看完整接口 JSON