请求体
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
email | string | 是 | 登录邮箱,服务端按小写处理 |
password | string | 是 | 登录密码 |
uuid | string | 否 | 登录验证码会话 UUID |
code | string | 否 | 登录验证码 |
provider | string | 绑定第三方账号时 | 授权平台,取值为 QQ、WECHAT、GITHUB、BILIBILI |
bindingTicket | string | 绑定第三方账号时 | 使用同一平台的 /api/auth/third-party/login 在 bound=false 时返回的短期一次性票据 |
普通密码登录可省略这两个字段。绑定已有会员时,同时提交邮箱、密码、provider 和 bindingTicket。旧版 openId 字段不能替代票据。
curl -X POST 'https://resource-api.xyeidc.com/api/auth/login' \
-H 'Api-Key: YOUR_API_KEY' \
-H 'Api-Secret: YOUR_API_SECRET' \
-H 'Content-Type: application/json' \
-d '{"email":"developer@example.com","password":"ExamplePass123"}'
响应示例
{
"code": 200,
"msg": "Success!",
"data": {
"memberId": 10001,
"isAdmin": false,
"token": "USER_ACCESS_TOKEN",
"createTime": 1786060800000,
"expireTime": 1786665600000
}
}
令牌属于敏感信息,请仅通过 HTTPS 传输并安全保存,不要写入日志或公开仓库。
