Appearance
单码卡密登录 POST
验证单码卡密并返回到期时间、Token、状态码等登录信息。
请求方法:
POSTContent-Type:application/x-www-form-urlencoded
💡 SDK 快速接入
官方 SDK 已支持此接口,您可以直接使用 SDK 一键调用,无需手动处理加密和签名。
SDK 调用示例
python
result = verify.login(card, machine_code)
if result['success']:
print(f"卡密ID: {result['id']}")
print(f"到期时间: {result['end_time']}")
statecode = result['statecode'] # 保存用于心跳javascript
const result = await verify.login(card, machineCode);
if (result.success) {
console.log(`到期时间: ${result.end_time}`);
const statecode = result.statecode;
}java
T3Verify.T3LoginResult result = verify.login(card, machineCode);
if (result.success) {
System.out.println("到期时间: " + result.endTime);
String statecode = result.statecode;
}csharp
var result = verify.Login(card, machineCode);
if (result.Success) {
Console.WriteLine($"到期时间: {result.EndTime}");
string statecode = result.Statecode;
}cpp
auto result = verify.login(card, machineCode);
if (result.success) {
std::cout << "到期时间: " << result.end_time << std::endl;
// result.statecode 用于心跳
}php
$result = $verify->login($card, $machineCode);
if ($result['success']) {
echo "到期时间: {$result['end_time']}\n";
$statecode = $result['statecode'];
}swift
let result = verify.login(kami: card, imei: machineCode)
if result.success {
print("到期时间: \(result.endTime ?? "")")
}请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
kami | string | 必填 | 单码卡密值 |
imei | string | 条件必填 | 机器码(设备唯一标识),不可包含 ' 号。开启机器码验证时必填 |
t | number | 条件必填 | 秒级 Unix 时间戳(10 位),开启时间戳验证时必填 |
s | string | 条件必填 | 请求签名,MD5 32 位小写。开启签名验证时必填 |
safe_code | string | 可选 | 数据验证码,服务器原样返回 |
通用参数
t、s、safe_code 为全局通用参数,详见 概述 → 通用参数。
成功响应
jsonc
{
"code": "200", // 状态码(成功值可在后台自定义)
"id": 1, // 单码卡密 ID
"end_time": "2026-04-10 12:00:00", // 到期时间
"amount": "30天", // 卡密时长描述(如 30天、永久卡、3次)
"available": 2592000, // 剩余秒数(次卡为剩余次数 - 1)
"token": "a1b2c3d4e5f6...", // 校验密钥(用于客户端二次校验)
"statecode": "f1e2d3c4b5a6...", // 登录状态码(用于心跳验证)
"safe_code": "hello", // 原样返回的数据验证码
"time": 1741700000, // 服务器时间戳
"date": "202603111200", // 服务器日期分钟
"imei": "DEVICE_001", // 绑定的机器码
"change": 0, // 已解绑次数
"core": "48656c6c6f" // 核心数据(Hex 编码)
}txt
登录成功
卡密ID:1
到期时间:2026-04-10 12:00:00
卡密时长:30天
剩余时间:2592000
校验密钥:a1b2c3d4e5f6
登录状态码:f1e2d3c4b5a6
数据验证码:hello
当前时间:202603111200
当前时间戳:1741700000
绑定设备:DEVICE_001
解绑次数:0
核心数据:48656c6c6fToken 与 statecode
Token 校验
Token 用于客户端二次验证,验证响应数据是否被篡改。
txt
token = md5(卡密ID + APPKEY + 到期时间字符串 + 当前日期分钟)txt
token = md5(卡密ID + APPKEY + 签名原文 + 到期时间字符串 + 当前日期分钟)statecode 说明
statecode = md5(token + 当前时间戳)用于 心跳验证 接口,在「登录状态码有效期」内有效。
错误列表
业务错误
| 错误消息 | 原因 |
|---|---|
卡密不可为空 | 未传 kami 参数 |
机器码不可为空 | 开启机器码验证但未传 imei |
机器码不合法,因为存在'号 | imei 中包含 ' 字符 |
卡密不存在 | 卡密值不存在或已删除 |
卡密被禁用 | 卡密被后台禁用 |
卡密已到期 | 卡密已过期 |
卡密使用次数已达上限 | 次卡的可用次数已用完 |
卡密禁止登录 | 开启了空设备禁登但卡密未绑定设备 |
设备 / IP 错误
| 错误消息 | 原因 |
|---|---|
请在原设备登录 | 机器码不一致 |
请在原IP登录 | IP 地址不一致(精确模式) |
请在原省内登录 | IP 不在同一省份 |
请在市内登录 | IP 不在同一城市 |
通用错误
| 错误消息 | 原因 |
|---|---|
程序未开启 | 程序未启用 |
接口未开启 | 该接口未启用 |
时间戳参数不可为空 | 开启时间戳验证但未传 t |
验证数据已失效,请重试 | 时间戳校验失败(排障指南) |
签名参数不可为空 | 开启签名验证但未传 s |
签名有误 | 签名校验失败 |