Skip to content

Commit

Permalink
fix: captcha 2023.11.17
Browse files Browse the repository at this point in the history
  • Loading branch information
TRHX committed Nov 17, 2023
1 parent 6721c45 commit 04bb660
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,26 +100,26 @@ article: false
<script src="https://static.geetest.com/static/js/gt.0.4.9.js"></script>
<script>
var handler = function (captchaObj) {
$("#submit").click(function (e) {
$('#submit').click(function (e) {
var result = captchaObj.getValidate();
if (!result) {
$("#notice").show();
$('#notice').show();
setTimeout(function () {
$("#notice").hide();
$('#notice').hide();
}, 2000);
e.preventDefault();
}
});
// 将验证码加到id为captcha的元素里,同时会有三个input的值用于表单提交
captchaObj.appendTo("#captcha");
captchaObj.appendTo('#captcha');
captchaObj.onReady(function () {
$("#wait").hide();
$('#wait').hide();
});
};
$.ajax({
url: "https://api.spiderapi.cn/geetest/register?t=" + (new Date()).getTime(), // 加随机数防止缓存
type: "get",
dataType: "json",
url: 'https://api.spiderapi.cn/geetest/register?t=' + (new Date()).getTime(), // 加随机数防止缓存
type: 'get',
dataType: 'json',
success: function (data) {
// 调用 initGeetest 初始化参数
// 参数1:配置参数
Expand All @@ -129,8 +129,8 @@ article: false
challenge: data.challenge,
new_captcha: data.new_captcha, // 用于宕机时表示是新验证码的宕机
offline: !data.success, // 表示用户后台检测极验服务器是否宕机,一般不需要关注
product: "float", // 产品形式,包括:float,popup
width: "100%"
product: 'float', // 产品形式,包括:float,popup
width: '100%'
}, handler);
}
});
Expand Down

0 comments on commit 04bb660

Please sign in to comment.