{
  "tags": [
    "账户资料"
  ],
  "description": "获取当前登录用户的账户资料、实名认证与企业认证状态、二次认证设置、余额和用户组。身份证姓名和号码会脱敏后返回。未登录时不能访问。",
  "operationId": "user_get_v1_user",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "请求已被处理。成功时 `code` 为 0、`msg` 为“获取成功!”、`data` 为当前用户资料；未登录时仍返回 HTTP 200。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "code",
              "msg",
              "data"
            ],
            "properties": {
              "code": {
                "type": "integer",
                "description": "业务状态码；成功为 0。",
                "example": 0
              },
              "msg": {
                "type": "string",
                "description": "处理结果说明。",
                "example": "获取成功!"
              },
              "data": {
                "type": "object",
                "description": "当前登录用户资料。",
                "required": [
                  "id",
                  "name",
                  "balance",
                  "cert_verified"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "用户 ID。"
                  },
                  "name": {
                    "type": "string",
                    "description": "用户名。"
                  },
                  "email": {
                    "type": "string",
                    "nullable": true,
                    "description": "邮箱地址。"
                  },
                  "phone": {
                    "type": "string",
                    "nullable": true,
                    "description": "手机号。"
                  },
                  "qq": {
                    "type": "string",
                    "nullable": true,
                    "description": "QQ 号。"
                  },
                  "balance": {
                    "type": "number",
                    "description": "账户余额。"
                  },
                  "create_at": {
                    "type": "string",
                    "description": "注册时间，格式为 YYYY-MM-DD HH:mm:ss。"
                  },
                  "user_group": {
                    "type": "integer",
                    "nullable": true,
                    "description": "用户组 ID。"
                  },
                  "group_name": {
                    "type": "string",
                    "nullable": true,
                    "description": "用户组名称。"
                  },
                  "cert_id": {
                    "type": "integer",
                    "nullable": true,
                    "description": "实名认证证书 ID。"
                  },
                  "cert_name": {
                    "type": "string",
                    "description": "脱敏后的实名姓名。"
                  },
                  "cert_no": {
                    "type": "string",
                    "description": "脱敏后的证件号码。"
                  },
                  "cert_verified": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ],
                    "description": "个人实名认证状态。"
                  },
                  "id_auth_way": {
                    "type": "string",
                    "nullable": true,
                    "description": "实名认证方式。"
                  },
                  "company_auth_enable": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ],
                    "description": "系统是否启用企业认证。"
                  },
                  "company_name": {
                    "type": "string",
                    "nullable": true,
                    "description": "企业名称。"
                  },
                  "company_credit_code": {
                    "type": "string",
                    "nullable": true,
                    "description": "统一社会信用代码。"
                  },
                  "company_verified": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ],
                    "description": "企业认证状态。"
                  },
                  "auth2_enable": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ],
                    "description": "是否启用二次认证。"
                  },
                  "auth2_verified": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ],
                    "description": "当前二次认证是否已验证。"
                  },
                  "auth2_end_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "二次认证有效截止时间。"
                  },
                  "auth2_expire_action": {
                    "type": "string",
                    "description": "二次认证过期处理动作。"
                  },
                  "login_captcha": {
                    "type": "string",
                    "nullable": true,
                    "description": "登录二次验证方式。"
                  },
                  "white_ip": {
                    "type": "string",
                    "nullable": true,
                    "description": "登录 IP 白名单。"
                  }
                }
              }
            }
          },
          "examples": {
            "success": {
              "summary": "获取成功",
              "value": {
                "code": 0,
                "msg": "获取成功!",
                "data": {
                  "id": 12,
                  "name": "demo",
                  "email": "demo@example.invalid",
                  "phone": "138****0000",
                  "balance": 100.5,
                  "cert_name": "张*",
                  "cert_no": "1****************8",
                  "cert_verified": 1,
                  "company_auth_enable": 1,
                  "company_verified": 0,
                  "auth2_enable": 0,
                  "auth2_verified": 0
                }
              }
            },
            "notLoggedIn": {
              "summary": "未登录",
              "value": {
                "code": "user-48",
                "msg": "请登录",
                "data": ""
              }
            }
          },
          "example": {
            "code": 0,
            "msg": "获取成功!",
            "data": {
              "id": 12,
              "name": "demo",
              "email": "demo@example.invalid",
              "phone": "138****0000",
              "balance": 100.5,
              "cert_name": "张*",
              "cert_no": "1****************8",
              "cert_verified": 1,
              "company_auth_enable": 1,
              "company_verified": 0,
              "auth2_enable": 0,
              "auth2_verified": 0
            }
          }
        }
      }
    }
  },
  "x-python-handler": "user.UserAPI",
  "x-python-route-line": 185,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "user.UserAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 185
    },
    {
      "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/user",
  "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": "获取当前登录用户的账户资料、实名认证与企业认证状态、二次认证设置、余额和用户组。身份证姓名和号码会脱敏后返回。未登录时不能访问。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "user"
      ],
      "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"
        }
      ]
    }
  }
}