## 刷新令牌接口
> 接口说明:
1. 大部分接口通讯都需要头文件传递access-token,本接口通过登陆获取access-token令牌,同时获取用于刷新的refresh_token参数,用于令牌即将失效时进行刷新。
2. 在获取access_token令牌后,请使用缓存保存以便其他接口直接使用。
3. 注意在access_token令牌有效数量为5个时,将无法继续获取,所以请做好缓存。
4. 成功刷新令牌后会使原令牌【立即】失效。
~~~[api]
post:/auth/refresh_token
*refresh_token#用于刷新的令牌(由登陆接口中返回)
<<<
success
{
"code": 1,
"msg": "SUCCESS",
"data": {
"access_token": "2umabx0eo********18amu1j7a818",
"refresh_token": "ymqaiv6ynf********pll2a3zqlhdl33h",
"expires_in": 165********59,
"expires_time": "2022********2:39"
}
}
<<<
error
{
"code": 0,
"msg": "USER ERROR",
"data": {
"error": "用户名或密码错误"
}
}
~~~
接口成功返回参数说明:
| 参数 | 说明 |
| --- | --- |
| code | 成功返回1,错误时返回0 |
| data| 主要返回数据 |
| data.access_token| 授权令牌 |
| data.refresh_token| 刷新令牌 |
| data.expires_in| 过期时间戳 |
| data.expires_time| 过期时间 |