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

获取注册与用户协议配置

GET/v1/common/register-info

获取公开注册页面使用的字段要求和用户协议。配置由系统 register_require JSON 与 user_agreement JSON 合并返回;该公共接口不要求登录。

身份认证

无需身份认证。

请求参数

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

响应

HTTP 200

配置读取成功时返回注册字段规则和用户协议;数据库配置读取异常不会转换为业务错误响应。

application/json

object

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

成功状态码,注册配置读取成功时固定为 0。

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

配置读取成功时固定为空字符串。

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

公开注册字段要求及用户协议配置。

约束 / 默认值 / 示例
{
  "required": [
    "username",
    "email",
    "phone",
    "qq",
    "user_agreement"
  ],
  "additionalProperties": true
}
展开字段结构

公开注册字段要求及用户协议配置。

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

用户名注册规则。

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

用户名注册规则。

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

是否要求注册用户名:1 要求,0 不要求。

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

邮箱注册规则。 具体说明

约束 / 默认值 / 示例
{
  "required": [
    "need",
    "verify"
  ],
  "additionalProperties": true
}
展开字段结构

邮箱注册规则。 具体说明

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

是否要求填写邮箱。

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

是否要求邮箱验证。

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

手机号注册规则。

约束 / 默认值 / 示例
{
  "required": [
    "need",
    "verify"
  ],
  "additionalProperties": true
}
展开字段结构

手机号注册规则。

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

是否要求填写手机号。

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

是否要求手机验证。

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

QQ 注册规则。

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

QQ 注册规则。

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

是否要求填写 QQ。

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

用户协议内容。 具体说明

约束 / 默认值 / 示例
{
  "required": [
    "title",
    "data"
  ],
  "additionalProperties": true
}
展开字段结构

用户协议内容。 具体说明

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

用户协议显示标题。

datastring必填

用户协议、法律声明和隐私政策正文。

完整 Schema
{
  "type": "object",
  "required": [
    "code",
    "msg",
    "data"
  ],
  "properties": {
    "code": {
      "type": "integer",
      "enum": [
        0
      ],
      "description": "成功状态码,注册配置读取成功时固定为 0。"
    },
    "msg": {
      "type": "string",
      "enum": [
        ""
      ],
      "description": "配置读取成功时固定为空字符串。"
    },
    "data": {
      "type": "object",
      "required": [
        "username",
        "email",
        "phone",
        "qq",
        "user_agreement"
      ],
      "properties": {
        "username": {
          "type": "object",
          "required": [
            "need"
          ],
          "properties": {
            "need": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "description": "是否要求注册用户名:1 要求,0 不要求。"
            }
          },
          "additionalProperties": true,
          "description": "用户名注册规则。"
        },
        "email": {
          "type": "object",
          "required": [
            "need",
            "verify"
          ],
          "properties": {
            "need": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "description": "是否要求填写邮箱。"
            },
            "verify": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "description": "是否要求邮箱验证。"
            }
          },
          "additionalProperties": true,
          "description": "邮箱注册规则。 具体说明"
        },
        "phone": {
          "type": "object",
          "required": [
            "need",
            "verify"
          ],
          "properties": {
            "need": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "description": "是否要求填写手机号。"
            },
            "verify": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "description": "是否要求手机验证。"
            }
          },
          "additionalProperties": true,
          "description": "手机号注册规则。"
        },
        "qq": {
          "type": "object",
          "required": [
            "need"
          ],
          "properties": {
            "need": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "description": "是否要求填写 QQ。"
            }
          },
          "additionalProperties": true,
          "description": "QQ 注册规则。"
        },
        "user_agreement": {
          "type": "object",
          "required": [
            "title",
            "data"
          ],
          "properties": {
            "title": {
              "type": "string",
              "description": "用户协议显示标题。"
            },
            "data": {
              "type": "string",
              "description": "用户协议、法律声明和隐私政策正文。"
            }
          },
          "additionalProperties": true,
          "description": "用户协议内容。 具体说明"
        }
      },
      "additionalProperties": true,
      "description": "公开注册字段要求及用户协议配置。"
    }
  },
  "additionalProperties": false
}

示例

{
  "code": 0,
  "msg": "",
  "data": {
    "username": {
      "need": 1
    },
    "email": {
      "need": 1,
      "verify": 1
    },
    "phone": {
      "need": 0,
      "verify": 0
    },
    "qq": {
      "need": 0
    },
    "user_agreement": {
      "title": "用户协议",
      "data": "请阅读并同意相关协议。"
    }
  }
}

cURL 示例

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

curl --request GET \
  "https://master.example.invalid/v1/common/register-info"

查看完整接口 JSON