From 00a6ee0db24c7ac9caf3f9a5263ebd4d1b05ecb5 Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Thu, 22 Jan 2026 18:58:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=90=8E=E6=97=A0=E6=B3=95=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 评论提交成功后调用 geetestCaptcha.reset() 重置验证码实例 - 清空数学验证码输入框(之前错误地自动填充答案) - 确保用户可以连续提交多条评论而无需刷新页面 --- argontheme.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/argontheme.js b/argontheme.js index 33466ab..d7ef059 100644 --- a/argontheme.js +++ b/argontheme.js @@ -1679,11 +1679,12 @@ if (argonConfig.waterflow_columns != "1") { //复位评论表单 cancelReply(); $("#post_comment_content").val(""); + // 重置数学验证码 $("#post_comment_captcha_seed").val(result.newCaptchaSeed); $("#post_comment_captcha + style").html(".post-comment-captcha-container:before{content: '" + result.newCaptcha + "';}"); - $("#post_comment_captcha").val(result.newCaptchaAnswer); + $("#post_comment_captcha").val(""); // 清空验证码输入框 - // 清空Geetest验证码隐藏字段 + // 清空Geetest验证码隐藏字段并重置验证码实例 if ($("#geetest-captcha").length > 0) { $("#geetest_lot_number").val(""); $("#geetest_captcha_output").val(""); @@ -1693,6 +1694,14 @@ if (argonConfig.waterflow_columns != "1") { window.geetestVerified = false; // 重置自动提交标记 window.geetestAutoSubmitting = false; + // 重置 Geetest 实例,确保下一次可以重新验证 + if (window.geetestCaptcha) { + try { + window.geetestCaptcha.reset(); + } catch (e) { + ArgonDebug.warn('Geetest reset error:', e); + } + } } $("body,html").animate({ scrollTop: $("#comment-" + result.id).offset().top - 100