@sheepbao
2017-12-12T14:00:35.000000Z
字数 1652
阅读 1681
用户注册或者登入时发送验证码
/user/sendsms
POST
application/json
| 参数 | 必选 | 类型 | 说明 |
|---|---|---|---|
| phone | true | string | 用户的手机号 |
| action | true | string | 用户的行为,请填写"reg" |
JSON
| 返回字段 | 字段类型 | 说明 |
|---|---|---|
| status | int | 返回结果状态。 |
| msg | string | 失败或成功消息 |
curl -k -X POST -d '{"phone":"12345678901","action":"reg"}'
https://xxx.com/user/sendsms
{"status": 1000,"msg": "ok"}
微信公众号用户登入或注册
/user/wxofficial/login
POST
application/x-www-form-urlencoded
| 参数 | 必选 | 类型 | 说明 |
|---|---|---|---|
| code | true | string | 公众号请求微信后台获取的code |
| state | true | string | 自定义状态值,为"duocai" |
JSON
| 返回字段 | 字段类型 | 说明 |
|---|---|---|
| status | int | 返回结果状态码 |
| msg | string | 具体消息 |
| result | json | 返回的用户信息 |
| 参数 | 类型 | 说明 |
|---|---|---|
| id | string | 用户id |
| identity_type | string | 认证类型,"username" or "msgcode",表示用户名密码或者动态密码 |
| unionid | string | 微信unionid |
| username | string | 用户登入账号,如果该字段不存在,或者为空,则表示该用户未注册 |
| password | string | 用户登入密码 |
| creat_time | string | 用户创建的时间戳 |
| msg_code | string | 用户注册时获取的验证码 |
| nickname | string | 用户昵称 |
| family_name | string | 用户的姓 |
| real_name | string | 用户的名字 |
| sex | string | 用户性别 |
| birthday | string | 用户出生日期 |
| birth_province | string | 出生的省份 |
| birth_city | string | 出生的城市 |
| living_province | string | 现居住的省份 |
| living_city | string | 现居住的城市 |
| intro | string | 用户简介 |
| delete | bool | 用户是否删除 |
curl -k -X POST https://xx.com/user/wxofficial/login?code="code"&state="duocai"
{"status": 1000,"msg": "ok","result": {"id": "59bca3092eb92e44d3e24c79","identity_type": "username","username": "12345678901","create_time": "2017-10-01 09:00:00"}}
微信公众号用户绑定手机号
/user/wxofficial/bind
POST
application/x-www-form-urlencoded
| 参数 | 必选 | 类型 | 说明 |
|---|---|---|---|
| uid | true | string | 用户id |
| phone | true | string | 用户的电话号码 |
| code | true | string | 短信验证码 |
JSON
| 返回字段 | 字段类型 | 说明 |
|---|---|---|
| status | int | 返回结果状态码 |
| msg | string | 具体消息 |
curl -k -X POST https://xx.com/user/wxofficial/bind?uid="uid"&phone="12345678901"&code="123456"
{"status": 1000,"msg": "ok"}