仪表盘
📦
-
总卡密数
✅
-
未使用
🔓
-
已使用
⏰
-
已过期
快速操作
生成卡密
批量生成卡密
卡密列表
| 卡密 | 时长 | 状态 | 创建时间 | 过期时间 | 操作 |
|---|---|---|---|---|---|
| 加载中... | |||||
API 接口文档
⚙️ 基础配置
// API 基础地址
const API_BASE = 'https://51faka.llllove.com.cn';
// 请求头
const HEADERS = {
'Content-Type': 'application/json'
};
📝 最简使用示例
一行代码完成验证+激活!
// JavaScript
const result = await fetch(API_BASE + '/api/verify-activate', {
method: 'POST',
headers: HEADERS,
body: JSON.stringify({ license_key: 'XXXX-XXXX-XXXX-XXXX' })
}).then(r => r.json());
if (result.success) {
console.log('激活成功,剩余 ' + result.data.remaining_days + ' 天');
}
// Python
import requests
result = requests.post(API_BASE + '/api/verify-activate',
json={'license_key': 'XXXX-XXXX-XXXX-XXXX'}).json()
if result['success']:
print(f"激活成功,剩余 {result['data']['remaining_days']} 天")
🚀 推荐集成流程
// 1. 软件启动时检查卡密
async function onStart() {
const key = localStorage.getItem('license_key');
if (!key) return showInputDialog();
const status = await fetch(API_BASE + '/api/status/' + key).then(r=>r.json());
if (status.data.is_expired) return alert('卡密已过期');
console.log('软件已激活,剩余 ' + status.data.remaining_days + ' 天');
}
// 2. 用户输入卡密时激活
async function activate(key) {
const result = await fetch(API_BASE + '/api/verify-activate', {
method: 'POST',
body: JSON.stringify({ license_key: key })
}).then(r=>r.json());
if (result.success) localStorage.setItem('license_key', key);
return result;
}
📡 所有接口一览
| 方法 | 接口 | 说明 |
|---|---|---|
| POST | /api/verify |
验证卡密(不激活) |
| POST | /api/activate |
激活卡密 |
| GET | /api/status/:key |
查询卡密状态 |
| POST | /api/verify-activate |
一步验证+激活(推荐) |
| GET | /api/health |
健康检查 |
📋 接口详情
POST /api/verify - 验证卡密(不激活)
请求: { "license_key": "XXXX-XXXX-XXXX-XXXX" }
响应:
{
"success": true,
"valid": true,
"data": {
"valid": true,
"status": "active",
"expires_at": "2026-05-01T00:00:00Z",
"remaining_days": 30,
"used": false
}
}
POST /api/activate - 激活卡密
请求: { "license_key": "XXXX-XXXX-XXXX-XXXX", "machine_id": "可选" }
响应:
{
"success": true,
"message": "激活成功",
"data": { "expires_at": "...", "remaining_days": 30 }
}
GET /api/status/:key - 查询状态
响应:
{
"success": true,
"data": {
"status": "used",
"used": true,
"expires_at": "...",
"remaining_days": 30,
"is_expired": false
}
}
POST /api/verify-activate - 一步验证+激活(推荐)
请求: { "license_key": "XXXX-XXXX-XXXX-XXXX", "machine_id": "可选" }
响应:
{
"success": true,
"valid": true,
"message": "激活成功",
"data": { "expires_at": "...", "remaining_days": 30 }
}
GET /api/health - 健康检查
响应: { "success": true, "message": "服务正常运行", "timestamp": "..." }
💻 JavaScript / Node.js 完整示例
复制以下代码即可使用
const API_BASE = 'https://51faka.llllove.com.cn';
// 验证卡密
async function verifyLicense(key) {
const res = await fetch(`${API_BASE}/api/verify`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ license_key: key })
});
return res.json();
}
// 激活卡密
async function activateLicense(key, machineId) {
const res = await fetch(`${API_BASE}/api/activate`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ license_key: key, machine_id: machineId })
});
return res.json();
}
// 一步验证+激活
async function verifyAndActivate(key, machineId) {
const res = await fetch(`${API_BASE}/api/verify-activate`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ license_key: key, machine_id: machineId })
});
return res.json();
}
// 获取卡密状态
async function getStatus(key) {
const res = await fetch(`${API_BASE}/api/status/${key}`);
return res.json();
}
// 使用示例
const result = await verifyAndActivate('XXXX-XXXX-XXXX-XXXX');
if (result.success) {
console.log(`激活成功,剩余 ${result.data.remaining_days} 天`);
}
🐍 Python 完整示例
需要安装: pip install requests
import requests
API_BASE = 'https://51faka.llllove.com.cn'
# 一步验证+激活(推荐)
def verify_and_activate(key, machine_id=None):
resp = requests.post(
f'{API_BASE}/api/verify-activate',
json={'license_key': key, 'machine_id': machine_id}
)
return resp.json()
# 验证卡密
def verify_license(key):
resp = requests.post(f'{API_BASE}/api/verify',
json={'license_key': key})
return resp.json()
# 激活卡密
def activate_license(key, machine_id=None):
resp = requests.post(f'{API_BASE}/api/activate',
json={'license_key': key, 'machine_id': machine_id})
return resp.json()
# 查询状态
def get_status(key):
resp = requests.get(f'{API_BASE}/api/status/{key}')
return resp.json()
# 使用示例
result = verify_and_activate('XXXX-XXXX-XXXX-XXXX')
if result['success']:
print(f"激活成功,剩余 {result['data']['remaining_days']} 天")
🐘 PHP 完整示例
<?php
$API_BASE = 'https://51faka.llllove.com.cn';
// 一步验证+激活(推荐)
function verifyAndActivate($key, $machineId = null) {
global $API_BASE;
$data = ['license_key' => $key];
if ($machineId) $data['machine_id'] = $machineId;
$resp = file_get_contents($API_BASE . '/api/verify-activate', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/json",
'content' => json_encode($data)
]
]));
return json_decode($resp, true);
}
// 使用示例
$result = verifyAndActivate('XXXX-XXXX-XXXX-XXXX');
if ($result['success']) {
echo "激活成功,剩余 " . $result['data']['remaining_days'] . " 天";
}
?>
🔷 C# / .NET 完整示例
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class LicenseAPI
{
private const string API_BASE = "https://51faka.llllove.com.cn";
private static readonly HttpClient _client = new HttpClient();
// 一步验证+激活(推荐)
public static async Task<JsonDocument> VerifyAndActivate(string key)
{
var content = new StringContent(
JsonSerializer.Serialize(new { license_key = key }),
Encoding.UTF8, "application/json");
var resp = await _client.PostAsync($"{API_BASE}/api/verify-activate", content);
var json = await resp.Content.ReadAsStringAsync();
return JsonDocument.Parse(json);
}
// 使用示例
static async Task Main()
{
var result = await VerifyAndActivate("XXXX-XXXX-XXXX-XXXX");
if (result.RootElement.GetProperty("success").GetBoolean())
{
var days = result.RootElement.GetProperty("data").GetProperty("remaining_days").GetInt32();
Console.WriteLine($"激活成功,剩余 {days} 天");
}
}
}