OAuth 登录
金色童年
登录
Method and URL Structure
| Method |
Resource URL |
| POST |
/account/o/login/ |
Request Data
| Name |
Decription |
Required |
| code |
第三方平台返回的 code |
True |
| app |
第三方平台的名字: wechat, weibo, qq |
True |
Request Data
{ "code": "1234567890abcdef", "app": "wechat",}
Reponse
| Name |
Decription |
| app |
第三方平台的名字: wechat, weibo, qq |
| openid |
第三方平台的 openid |
| token |
身份验证 token |
| username |
openid 绑定的用户名 |
Response Data
{ "username": "13212345678", "token": "ffdf2561f854f6c888e10105d69ec364fef6c348", "app": "wechat", "openid": "888e10105d69e"}
登录时没有返回 username 或 token,需要执行绑定操作
绑定前请求验证码
Method and URL Structure
| Method |
Resource URL |
| GET |
/account/o/bind_request/ |
Request Parameters
| Name |
Decription |
Required |
| username |
绑定的手机号 |
True |
Reponse
这个参数表示是不是需要注册,
请求绑定接口时带上这个参数
| Name |
Description |
| signup |
没有注册的用户返回: true |
Response Data
{ "signup": "true"}
绑定
Method and URL Structure
| Method |
Resource URL |
| POST |
/account/o/bind/ |
Request Parameters
| Name |
Decription |
Required |
| username |
绑定的手机号 |
True |
| openid |
第三方平台 openid |
True |
| signup |
是否同时注册 |
True |
| verification_code |
验证码 |
True |
| password |
注册时带上密码 |
|
Reponse
| Name |
Decription |
| app |
第三方平台的名字: wechat, weibo, qq |
| openid |
第三方平台的 openid |
| token |
身份验证 token |
| username |
openid 绑定的用户名 |
Response Data
{ "username": "13212345678", "token": "ffdf2561f854f6c888e10105d69ec364fef6c348", "app": "wechat", "openid": "888e10105d69e"}