{
  "openapi": "3.0.3",
  "info": {
    "title": "OpenAPI 接口 - 会员登录",
    "version": "1.0.0",
    "description": "OpenAPI 接口相关接口文档"
  },
  "paths": {
    "/openapi/memberships/login": {
      "post": {
        "summary": "会员登录",
        "description": "同时支持企业账号与散客账号的登录校验，并返回加密的登录令牌。如果用户有多个可用站点，会返回站点信息。散客账号登录时必须包含同意协议字段。",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "登录令牌，包含手机号、密码和同意协议信息（散客账号必填），格式为 Bearer TOKEN。令牌 payload 应包含：phone（手机号）、password（密码）、agreeTerms（同意协议，散客账号必填且必须为 true）",
            "example": "Bearer {token}"
          },
          {
            "name": "X-System-Code",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "系统编码。用于指定当前登录的业务系统（例如 AUTH_MANAGEMENT、CONTENT_MANAGEMENT）。当系统不支持时将返回“登录用户不支持当前系统，可联系管理员处理”。"
          }
        ],
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "example": {
                  "success": {
                    "code": "0000",
                    "message": "登录成功",
                    "data": {
                      "token": "eyJhbGciOiJIUzI1NiIs...",
                      "user": {
                        "id": "BAKj1wKp7etrmSAT",
                        "code": "USER000001",
                        "username": "企业管理员",
                        "phone": "13800138000",
                        "email": "admin@example.com",
                        "individualism": true,
                        "status": 1,
                        "createTime": "2025-01-21T10:00:00.000Z",
                        "accountType": "user",
                        "type": "普通用户"
                      },
                      "companyName": "靖苒数字",
                      "site": {
                        "id": "site-id",
                        "key": "56B57A72-59C4-460B-82E5-22196205391B-A4608B6E9D4D6F599",
                        "name": "所属站点",
                        "createTime": "2025-01-21T10:00:00.000Z"
                      }
                    }
                  },
                  "failure": {
                    "code": "1302",
                    "message": "当前账号处于黑名单状态",
                    "data": null
                  },
                  "failureAgreeTerms": {
                    "code": "1303",
                    "message": "请同意隐私等协议",
                    "data": null
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}