跳到正文
文章入门

用 Turnstile 保护表单

使用 Cloudflare Turnstile 保护登录、注册和联系表单:在表单中加入组件,并在服务端通过 Siteverify 校验令牌。

最近更新
2026年5月5日
阅读原文

该介绍目前仅提供英文版本。

Turnstile is Cloudflare’s privacy-friendly CAPTCHA alternative. Add the widget on the client, then verify the token it produces on your server with the Siteverify API before accepting the form.

What you’ll learn

  • Get a Turnstile site key and secret key
  • Add the widget to an HTML form
  • Verify the token on the server side
  • Important considerations for production

Cloudflare products used

Turnstile.

Follow the full, step-by-step tutorial in Cloudflare’s documentation.

继续学习