用户登录 POST

用户账号登录验证,返回到期时间、Token、状态码等信息。请求方法: POST  Content-Type: application/x-www-form-urlencoded

SDK 调用示例

PythonNode.jsJavaC#PHPpython

result = verify.user_login('username', 'password', machine_code)
if result['success']:
    print(f"到期时间: {result['end_time']}")
    user_statecode = result['statecode']

javascript

const result = await verify.userLogin('username', 'password', machineCode);
if (result.success) {
    console.log(`到期时间: ${result.end_time}`);
    const statecode = result.statecode;
}

java

T3Verify.T3LoginResult result = verify.userLogin("username", "password", machineCode);
if (result.success) {
    System.out.println("到期时间: " + result.endTime);
}

csharp

var result = verify.UserLogin("username", "password", machineCode);
if (result.Success) Console.WriteLine($"到期时间: {result.EndTime}");

php

$result = $verify->userLogin('username', 'password', $machineCode);
if ($result['success']) echo "到期时间: {$result['end_time']}\n";

请求参数

参数类型必填说明
userstring必填用户名(≥ 6 位)
passstring必填密码(≥ 6 位,不可与用户名相同)
imeistring条件必填机器码(设备唯一标识),开启机器码验证时必填
tnumber条件必填秒级 Unix 时间戳
sstring条件必填请求签名
safe_codestring可选数据验证码

成功响应

JSON 格式文本格式jsonc

{
  "code": "200",                        // 状态码
  "id": 1,                              // 用户 ID
  "recharge": 3,                        // 充值次数
  "use_time": "2026-03-01 10:00:00",    // 激活时间
  "end_time": "2026-04-10 10:00:00",    // 到期时间
  "available": 2592000,                  // 剩余秒数
  "token": "a1b2c3d4e5f6...",            // 校验密钥
  "statecode": "f1e2d3c4b5a6...",        // 登录状态码(用于心跳验证)
  "time": 1741700000,                    // 服务器时间戳
  "date": "202603111200",               // 服务器日期分钟
  "imei": "DEVICE_001",                 // 绑定的机器码
  "change": 0,                           // 已解绑次数
  "core": "48656c6c6f"                   // 核心数据(Hex 编码)
}

txt

登录成功
用户ID:1
充值次数:3
激活时间:2026-03-01 10:00:00
到期时间:2026-04-10 10:00:00
剩余时间:2592000
校验密钥:a1b2c3d4e5f6
登录状态码:f1e2d3c4b5a6
当前时间:202603111200
当前时间戳:1741700000
绑定设备:DEVICE_001
解绑次数:0
核心数据:48656c6c6f

错误列表

业务错误

错误消息原因
用户名不可为空未传 user
密码不可为空未传 pass
用户名不可低于6位user 长度 < 6
密码不可低于6位pass 长度 < 6
用户名密码不可相同user 和 pass 一样
用户不存在用户名不存在
用户名或密码错误密码不正确
用户被禁用用户被后台禁用
请先充值后使用用户未充值激活
用户使用时间已到期用户已过期

设备 / IP 错误

错误消息原因
请在原设备登录机器码不一致
请在原IP登录IP 不一致(精确模式)
请在原省内登录IP 不同省
请在市内登录IP 不同市

通用错误

错误消息原因
程序未开启 / 接口未开启程序或接口未启用
时间戳参数不可为空开启时间戳验证但未传 t
验证数据已失效,请重试时间戳校验失败(排障指南)
签名参数不可为空开启签名验证但未传 s
签名有误签名校验失败