组件试用
滑一下,看看它怎么工作。
这里加载的是正式接入使用的同一个组件,连接官网试用站点完成真实挑战。不需要账号,也不会消耗任何额度。
示例表单
创建一个账号
Node.js · 服务端校验
// 提交时:兑换 token,成功后才执行业务
const saved = session.captcha;
const result = await fetch("https://captcha.moe/siteverify", {
method: "POST",
headers: {
authorization: `Bearer ${process.env.CAPTCHA_SECRET}`,
"content-type": "application/json",
},
body: JSON.stringify({
response: form.get("moe-captcha-response"),
intent_id: saved.intentId,
action: "signup",
hostname: "example.com",
idempotency_key: saved.nonce,
}),
}).then((res) => res.json());
if (result.success === true) {
// 创建账号
}