跳至内容
菜单
此问题已终结

The js script looks like this:


var sweetcaptcha = new require('sweetcaptcha')(appId, appKey, appSecret); // your sweetCaptcha application credentials, see https://sweetcatpcha.com/accounts/signin
// Get your captcha
function getCaptcha(callback) {
sweetcaptcha.api('get_html', callback); // callback should be function(err, html) {...}
}
// Validate using sckey and scvalue, hidden inputs from previous HTML
function validateCaptcha(captchaKey, captchaValue, callback) {
// callback = function(err, isValid) {...}
sweetcaptcha.api('check', {sckey: captchaKey, scvalue: captchaValue}, function(err, response){
if (err) return callback(err);
if (response === 'true') {
// valid captcha
return callback(null, true);
}
// invalid captcha
callback(null, false);
});
}
形象
丢弃
相关帖文 回复 查看 活动
2
5月 25
9119
3
3月 24
4698
0
4月 23
442
1
11月 23
4957
2
12月 22
5297