用户心跳验证 POST
用户登录后定期调用,维持在线状态。超时未调用将被视为离线。请求方法: POST Content-Type: application/x-www-form-urlencoded
SDK 调用示例
PythonNode.jsJavaC#PHPpython
result = verify.user_heartbeat('username', 'password', user_statecode)
if result['success']:
print("心跳验证成功")
javascript
const result = await verify.userHeartbeat('username', 'password', statecode);
if (result.success) console.log('心跳验证成功');
java
T3Verify.T3Result result = verify.userHeartbeat("username", "password", statecode);
if (result.success) System.out.println("心跳验证成功");
csharp
var result = verify.UserHeartbeat("username", "password", statecode);
if (result.Success) Console.WriteLine("心跳验证成功");
php
$result = $verify->userHeartbeat('username', 'password', $statecode);
if ($result['success']) echo "心跳验证成功\n";
调用时机登录成功后,按「登录状态码有效期」内定期调用。建议间隔为有效期的 1/2 ~ 2/3。
请求参数
statecode | string | 必填 | 登录时返回的 statecode 值(32 位字符串) |
成功响应
JSON 格式文本格式jsonc
{
"code": "200", // 状态码
"msg": "在线", // 结果消息
"time": 1741700000, // 服务器时间戳
"date": "202603111200" // 服务器日期分钟
}
txt
在线
当前时间:202603111200
当前时间戳:1741700000
错误列表
心跳错误
状态码不存在 | statecode 长度不是 32 位 |
登录状态不存在 | statecode 在心跳记录中不存在 |
通用错误