集成极验 GT4 人机验证的安全账号分发方案。支持 H5 / Android / iOS / 小程序多端接入。
从集成到上线只需 5 步
在 APP / H5 中集成极验 GT4 SDK
调起极验验证码
SDK 返回 4 个参数
POST 到 api_claim.php
校验通过后返回账号
领取接口接受极验验证参数,服务端校验后返回账号密码。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
lot_number | string | 是 | 极验验证流水号,SDK 自动生成 |
captcha_output | string | 是 | 极验验证输出,SDK 自动生成 |
pass_token | string | 是 | 极验通过标识,SDK 自动生成 |
gen_time | string | 是 | 极验时间戳,SDK 自动生成 |
{
"success": true,
"data": {
"username": "游戏账号",
"password": "对应密码",
"get_time": "2026-05-24 23:43:00"
},
"remaining": 3
}
{
"success": false,
"message": "今日领取次数已用完"
}
各端完整对接示例,复制即用。
<!-- 引入极验 GT4 SDK --> <script src="https://static.geetest.com/v4/gt4.js"></script> <button id="claimBtn">🎮 领取账号</button> <script> const API = 'https://4399.fzyidc.com/api_claim.php'; const CID = 'd6545edb20e9d3af0ba00c7549cd27c6'; document.getElementById('claimBtn') .addEventListener('click', () => { initGeetest4({ captchaId: CID, product: 'bind' }, instance => { instance.onSuccess(() => { const r = instance.getValidate(); fetch(API, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({ lot_number: r.lot_number, captcha_output: r.captcha_output, pass_token: r.pass_token, gen_time: r.gen_time }) }).then(r => r.json()) .then(d => { if (d.success) alert( `账号: ${d.data.username}` + `\n密码: ${d.data.password}` ); else alert(d.message); }); }); instance.show(); }); }); </script>
<script> const API = 'https://4399.fzyidc.com/api_claim.php'; export default { methods: { handleClaim() { // #ifdef H5 const s = document.createElement('script'); s.src = 'https://static.geetest.com/v4/gt4.js'; s.onload = () => { initGeetest4({ captchaId: 'd6545...', product: 'bind' }, inst => { inst.onSuccess(() => { const r = inst.getValidate(); this.doClaim(r); }); inst.show(); }); }; document.head.appendChild(s); // #endif }, async doClaim(r) { const res = await uni.request({ url: API, method: 'POST', header: { 'Content-Type': 'application/x-www-form-urlencoded' }, data: r }); if (res.data.success) { uni.showToast({ title: '领取成功', icon: 'success' }); } } } } </script>
// 极验通过后拿到参数 String lot_number = result.getLotNumber(); String captcha_output = result.getCaptchaOutput(); String pass_token = result.getPassToken(); String gen_time = result.getGenTime(); RequestBody body = new FormBody.Builder() .add("lot_number", lot_number) .add("captcha_output", captcha_output) .add("pass_token", pass_token) .add("gen_time", gen_time) .build(); Request req = new Request.Builder() .url("https://4399.fzyidc.com/api_claim.php") .post(body).build(); Response resp = client.newCall(req).execute(); JSONObject obj = new JSONObject( resp.body().string() ); if (obj.getBoolean("success")) { JSONObject data = obj .getJSONObject("data"); String user = data .getString("username"); String pass = data .getString("password"); // 显示账号密码 }
var req = URLRequest( url: URL(string: "https://4399.fzyidc.com/api_claim.php" )! ) req.httpMethod = "POST" req.httpBody = "lot_number=\(lot_number)" + "&captcha_output=\(captcha_output)" + "&pass_token=\(pass_token)" + "&gen_time=\(gen_time)" .data(using: .utf8) URLSession.shared.dataTask( with: req ) { data, _, _ in guard let d = data, let j = try? JSONSerialization .jsonObject(with: d) as? [String: Any], let ok = j["success"] as? Bool else { return } if ok, let data = j["data"] as? [String:String] { let user = data["username"] let pass = data["password"] } }.resume()
上线前需要完成的配置项。
d6545edb20e9d3af0ba00c7549cd27c6api_claim.php完整示例代码,开箱即用。