[关闭]
@chengxuyuan 2019-06-10T09:49:41.000000Z 字数 1156 阅读 382

验证码登录

橙旭园儿童编程


获取验证码

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

  1. {
  2. "username": "18012345678"
  3. }

cURL Example

  1. curl http://localhost:8000/server/userinfo/login_request/?username=18012345678

Response

  1. {
  2. "status":0,
  3. "message":""
  4. }

登录/注册

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

  1. {
  2. "username": "18012345678",
  3. "verification_code": "234567",
  4. "promotion": "true",
  5. "agent_number": "bj12345678",
  6. "coupon": "0999929292"
  7. }

cURL Example

  1. 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

  1. {
  2. "token": "6008e7a33e23e476c44efc14d2b83aaa59328fb7",
  3. "is_staff": false,
  4. "free_msg": {
  5. "status": -2,
  6. "message": ""
  7. },
  8. "name": "小橙子_tsk1cl",
  9. "promo_code": "65459972",
  10. "position": "student"
  11. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注