接口模型.md
3.8 KB
统一用户中心
登录
- URL: /v1/ucenter/login
- 格式: JSON
- HTTP请求方式: POST
-
请求示例
{ "phone": "18860180001", "code": "784657", "grantType": "signInPassword", "password": "123456" }
-
应答示例
{ "code": 0, "msg": "成功", "data": { "uid": 3507839547244544, "module": [ { "name": "opportunity" }, { "name": "question" } ] } }
data.uid 统一用户中心uid
data.module 有权限的模块
认证
登录
- URL: /v1/auth/login
- 格式: JSON
- HTTP请求方式: POST
-
请求示例
{ "uid":3507839547244544 }
-
应答示例
{ "code": 0, "msg": "登录成功", "data": { "authCode": "f7641e7d1cb811ea942d000c29ad8d6d" } }
短信验证码
- URL: /v1/auth/smsCode
- 格式: JSON
- HTTP请求方式: POST
-
请求示例
{ "phone":"18860180001" }
-
应答示例
{ "code": 0, "msg": "登录成功", "data":{} }
获取token
- URL: /v1/auth/accessToken
- 格式: JSON
- HTTP请求方式: POST
-
请求示例
{ "clientId":"lks3Z8Ncn2j", "clientSecret":"gtfhyjukiol3Qncbvmdwe67khh", "authCode":"5251839614a611eaab01000c29ad8d6d" }
-
应答示例
{ "code": 0, "msg": "成功", "data": { "refreshToken": "8debc5a314a611eaab01000c29ad8d6d", "accessToken": "8debc59814a611eaab01000c29ad8d6d", "expiresIn": 3600 } }
获取token
- URL: /v1/auth/accessToken
- 格式: JSON
- HTTP请求方式: POST
-
请求示例
{ "clientId":"lks3Z8Ncn2j", "clientSecret":"gtfhyjukiol3Qncbvmdwe67khh", "authCode":"5251839614a611eaab01000c29ad8d6d" }
-
应答示例
{ "code": 0, "msg": "成功", "data": { "refreshToken": "8debc5a314a611eaab01000c29ad8d6d", "accessToken": "8debc59814a611eaab01000c29ad8d6d", "expiresIn": 3600 } }
刷新token
- URL: /v1/auth/refreshToken
- 格式: JSON
- HTTP请求方式: POST
-
请求示例
{ "clientId":"lks3Z8Ncn2j", "clientSecret":"gtfhyjukiol3Qncbvmdwe67khh", "refreshToken":"8debc5a314a611eaab01000c29ad8d6d" }
-
应答示例
{ "code": 0, "msg": "成功", "data": { "refreshToken": "8debc5a314a611eaab01000c29ad8d6d", "accessToken": "dd57fa4914a611eaab01000c29ad8d6d", "expiresIn": 3600 } }
更新设备
- URL: /v1/auth/updateDevice
- 格式: JSON
- HTTP请求方式: POST
-
请求示例
{ "clientId":"123456", "deviceToken":"123456" }
-
应答示例
{ "code": 0, "msg": "更新成功", "data": null }
注销登录
- URL: /v1/auth/rovoke
- 格式: JSON
- HTTP请求方式: POST
- 请求示例 ```json {
}
* 应答示例
```json
{
"code": 0,
"msg": "成功",
"data":{}
}
用户中心
修改手机号 检查手机验证码
- URL: /v1/user/checkSmsCode
- 格式: JSON
- HTTP请求方式: POST
-
请求示例
{ "captcha":"252051" }
-
应答示例
{ "code": 0, "msg": "成功", "data":{} }
修改手机号
- URL: /v1/user/changePhone
- 格式: JSON
- HTTP请求方式: POST
-
请求示例
{ "phone":"18860180001", "captcha":"077163" }
-
应答示例
{ "code": 0, "msg": "成功", "data":{} }
重置密码
- URL: /v1/user/resetPassword
- 格式: JSON
- HTTP请求方式: POST
-
请求示例
{ "newPwd":"123456", "confirmPwd":"123456" }
-
应答示例
{ "code": 0, "msg": "成功", "data":{} }
修改密码
- URL: /v1/user/changePassword
- 格式: JSON
- HTTP请求方式: POST
-
请求示例
{ "newPwd":"1234567", "confirmPwd":"1234567", "oldPwd":"123456" }
-
应答示例
{ "code": 0, "msg": "成功", "data":{} }