[关闭]
@JackieQu 2018-06-05T12:22:15.000000Z 字数 2270 阅读 275

注册登录

儿童编程


注册或登录请求验证码(手机号)

Method and Url Structure

Method Resource URL
GET /userinfo/login_request/

Request and Parameters

Name Description Required Default
username 用户名 YES

Reques)

  1. ?username=17611237765

cURL Example

  1. curl -X GET -H 'Authorization: Token tester001' -d data{...}
  2. https://app.bcjiaoyu.com/server/userinfo/login_request/?username=17611237765

JSON Response

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

注册或登录(手机号)

Method and Url Structure

Method Resource URL
POST /userinfo/login_verifycode/

Request and Parameters

Name Description Required Default
username 用户名 YES
verification_code 验证码 YES
userinfo 用户信息 YES

Request

  1. {
  2. "username":"17611237765",
  3. "verification_code":"883315",
  4. "userinfo":{
  5. "inviter": "13263699826", // 邀请者,可不填
  6. "name":"tester",
  7. "avatar":"https://static1.bcjiaoyu.com/head.png"
  8. }
  9. }

cURL Example

  1. curl -X POST -H 'Authorization: Token tester001' -d data{...}
  2. https://app.bcjiaoyu.com/server/userinfo/login_verifycode/

JSON Response

  1. {
  2. "token": "2eb42021841352389adde05a0e9fe0770b3d88b8"
  3. }
  4. # 或 create 为 true 时调“邀请注册添加钻石记录”接口
  5. {
  6. "token": "728326686e160c416393f4dda78d1069239d0288",
  7. "create": true
  8. }

邀请注册添加钻石记录

Method and Url Structure

Method Resource URL
POST /userinfo/diamond_record/

Request and Parameters

Name Description Required Default
inviter 邀请者 YES
newuser 新用户 YES

Request

  1. {
  2. "inviter": "tester001",
  3. "newuser": "tester002"
  4. }

cURL Example

  1. curl -X POST -H -d data{...}
  2. https://www.cxy61.com/program_face2face/userinfo/diamond_record/

JSON Response

  1. {
  2. "message": "添加记录成功"
  3. }
  4. # 错误信息
  5. {
  6. "status": -4,
  7. "message": "数据错误" "非邀请者关系"
  8. }

登录(微信小程序)

Method and Url Structure

Method Resource URL
POST /userinfo/login_wx/

Request and Parameters

Name Description Required Default
code 微信code YES

Request

  1. {
  2. "code": "0817ww0S02Vuo829PQ1S0VaE0S07ww0t"
  3. }

cURL Example

  1. curl -X POST -H 'Authorization: Token tester001' -d data{...}
  2. https://127.0.0.1:8000/program_face2face/userinfo/login_wx/

JSON Response

  1. {
  2. "session": 300863339045
  3. }
  4. # 注册后返回
  5. {
  6. "token": "68b1ecb9c1636228f3aadc8dc038c7288f2dd440",
  7. "session": 647038024680
  8. }
  9. // 647038024680
  10. // vzCyGQEt6FZsLcwZFaHIFA==&o-vlb5ZTnIXZlCNod9cBWor-Sn4k

注册(微信小程序)

Method and Url Structure

Method Resource URL
POST /userinfo/signup_wx/

Request and Parameters

Name Description Required Default
session 接口返回数据 YES
name 用户名 YES
avatar 头像 YES

Request

  1. {
  2. "session": 300863339045,
  3. "name": "tester",
  4. "avatar": "img"
  5. }

cURL Example

  1. curl -X POST -H 'Authorization: Token tester001' -d data{...}
  2. https://127.0.0.1:8000/program_face2face/userinfo/signup_wx/

JSON Response

  1. {
  2. "token": "6ccfd8085b6ab4b68c4866b068114791ba6208ee"
  3. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注