public function getgeetest() { $geetestconfig = Config::get('geetestconfig'); $geetest = new Geetest((array) $geetestconfig); Session('geetest_userid', $_SERVER['REQUEST_TIME']); Session('geetest_status', $geetest->pre_process(Session('geetest_userid'))); echo json_encode($geetest->get_response_str()); }
use Geetest\Geetest;
use Flc\Dysms\Client;
use Flc\Dysms\Request\SendSms;
use think\Config;
use think\Db;
use think\Session;
function geetest(){ var handler = function (captchaObj) { captchaObj.appendTo("#captcha"); captchaObj.onSuccess(function () { //验证成功执行 }); captchaObj.onReady(function () { //加载完毕执行 }); }; $.ajax({ url: "/getgeetest&t=" + (new Date()).getTime(), type: "get", dataType: "json", success: function (data) { $("#captcha").html(""); initGeetest({ gt: data.gt, challenge: data.challenge, product: "float", offline: !data.success }, handler); } }); } setTimeout(function(){geetest();},500);
本文为看恩吧原创文章,转载无需和我联系,但请注明来自knsay.com