通用请求返回值:
- 正常
返回值 | 说明 |
---|---|
200 | 请求成功 |
- 异常
返回值 | 说明 |
---|---|
500 | 参数错误、鉴权失败等 |
-
URL:
IP:Port/register
-
Method: Post
-
Request
/* HTTP header */ { "phone": "", //手机号,必填 "country": "", //国家,必填 "code": "",//验证码,必填 "password": "" //密码,必填 }
-
Response
{ "code": 201 }
提供candy-box的账户和密码,返回jwt的token,包含唯一的用户id
-
URL:
IP:Port/login
-
Method: Post
-
Request
/* HTTP header */ { "type": "", //可选:phone/email/username "value": "", //账号 "password": "" //密码 }
-
Response
{ "code": 200, "token": "",//jwt,包含用户id和token失效时间 "user": {} }