接入 CloudFlare Turnstile 记录
在逛 CloudFlare 的时候看到了 Turnstile,觉得好奇就去看了下文档才知道它是 CloudFlare 家的人机验证,刚好部署了图床管理就想着能不能试试接入它,做下记录。 1. 创建 Turnstile 组件 在 src/components 目录中创建一个新的 Turnstile 组件,比如 Turnstile.vue: <template> <div> <div id="cf-turnstile" :data-sitekey="siteKey"></div> </div> </template> <script setup lang="ts"> import {onMounted, ref} from "vue"; const props = defineProps<{ sitekey: { type: String, required: true } }>() const turnstileResponse = ref<string>('') const emit =...
