接口模型.md
3.4 KB
认证
登录
- 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/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":{} }
用户信息
- URL: /v1/user/userInfo
- 格式: JSON
- HTTP请求方式: POST
-
请求示例
{ }
-
应答示例
{ "code": 0, "msg": "成功", "data": { "user": { "uid": 1, "uname": "Jennifer Clark", "phone": "18065048301", "image": { "path": "https://wx.qlogo.cn/mmopen/vi_32/AA24UDKOHgm9gy631bhPkjbrhQysEicjQLDibACO3DNksPpLuuwOYVhUPCDFud0W07wuICfkmhYng3ZtQo59Juzw/132", "w": 0, "h": 0 }, "department": "部门1", "position": "董事长", "imToken": "741df673c1671f8fad6d5d20adfa165e", "companyId": 1, "company": "test_company" } } }