License Platform 提供 REST API 用于许可签发和验证。所有 API 均为 HTTP JSON。
用户付款后签发许可。
curl -X POST http://localhost:3456/api/issue \
-H 'Content-Type: application/json' \
-d '{"product":1,"deviceFingerprint":"设备指纹","tier":"standard"}'
验证许可文件有效性。
curl -X POST http://localhost:3456/api/verify \
-H 'Content-Type: application/json' \
-d '{"license":{...license.json内容...}}'
获取产品公钥。
注册开发者账号。
登录获取 Token。
获取产品列表。
创建产品。
获取统计数据。
在你的软件启动时请求 /api/verify 验证许可:
// Node.js 示例
const fs = require('fs');
async function checkLicense() {
const licPath = './license.json';
if (!fs.existsSync(licPath)) {
console.log('❌ 未找到许可文件,请购买');
return false;
}
const license = JSON.parse(fs.readFileSync(licPath, 'utf8'));
const res = await fetch('http://localhost:3456/api/verify', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ license })
});
const result = await res.json();
return result.valid;
}