【草稿】Google reCAPTCHA
<script src="https://www.recaptcha.net/recaptcha/api.js?render=%REACT_APP_RECAPTCHA%"></script>
<script>
grecaptcha.ready(function () {
grecaptcha.execute('%REACT_APP_RECAPTCHA%', { action: 'homepage' })
.then(function (token) {
fetch('%REACT_APP_API_URL%' + 'recaptcha', {
method: 'post', body: JSON.stringify({
token: token,
}),
}).then(function (response) {
console.log(response)
})
})
})
</script>