{
  "module": {
    "module": "认证模块",
    "moduleKey": "auth"
  },
  "api": {
    "title": "客户端用户登录",
    "method": "POST",
    "path": "/auth/client/login",
    "description": "客户端用户登录接口。如果用户有多个可用站点，会返回站点列表供前端选择。",
    "requestParams": {
      "body": {
        "phone": "string｜必填，手机号",
        "password": "string｜必填，登录密码"
      }
    },
    "responseExample": {
      "success": {
        "code": "0000",
        "message": "登录成功",
        "data": {
          "token": "jwt-token",
          "user": {
            "id": "CU0001",
            "name": "客户端管理员"
          },
          "scopeKeys": [
            {
              "key": "uuid-personal",
              "type": "personal",
              "label": "个人"
            },
            {
              "key": "uuid-org",
              "type": "organization",
              "organizationId": 1,
              "label": "示例公司"
            }
          ],
          "defaultScopeKey": "uuid-org"
        }
      },
      "failure": {
        "code": "4000",
        "message": "登录失败",
        "data": null
      }
    },
    "notes": [
      "如果用户有独立站点，availableSites 会包含两个站点：所属站点（type: owner）和个人站点（type: personal）",
      "前端可以通过 X-Site header 切换站点，切换后所有 API 请求将使用对应站点的数据库",
      "默认使用所属站点（isDefault: true），如需切换到个人站点，在后续请求中传递个人站点的 siteKey",
      "响应 data 包含 scopeKeys（可用 scope 列表）与 defaultScopeKey（默认 scope，有组织时为组织 key）"
    ]
  }
}