验证码登录
橙旭园儿童编程
获取验证码
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| GET |
/server/userinfo/login_request/ |
获取验证码 |
NO |
Request Parameters
| Name |
Description |
Required |
Default |
| username |
手机号 |
YES |
|
Request
{ "username": "18012345678"}
cURL Example
curl http://localhost:8000/server/userinfo/login_request/?username=18012345678
Response
{ "status":0, "message":""}
登录/注册
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| POST |
/server/userinfo/login_verifycode/ |
登录 |
NO |
Request Data
| Name |
Description |
Required |
Default |
| username |
用户名 |
YES |
|
| verification_code |
收到的验证码 |
YES |
|
| promotion |
做推广: true/false |
NO |
False |
| agent_number |
绑定代理商: 代理商编号 |
NO |
|
| coupon |
给用户发优惠券: 优惠券编号 |
NO |
|
Request Data
{ "username": "18012345678", "verification_code": "234567", "promotion": "true", "agent_number": "bj12345678", "coupon": "0999929292"}
cURL Example
curl -X POST -H 'Content-Type: application/json' --data '{...}' http://localhost:8000/server/userinfo/login_verifycode/
Reponse Data
| Name |
Description |
| token |
身份验证token |
| promo_code |
做推广码 |
| position |
帐号用途: 快废弃了 |
| is_staff |
是否管理员 |
Response
{ "token": "6008e7a33e23e476c44efc14d2b83aaa59328fb7", "is_staff": false, "free_msg": { "status": -2, "message": "" }, "name": "小橙子_tsk1cl", "promo_code": "65459972", "position": "student"}