diff --git a/captcha/v1/api2.js b/captcha/v1/api2.js index 22f213d..b30725a 100644 --- a/captcha/v1/api2.js +++ b/captcha/v1/api2.js @@ -288,33 +288,26 @@ }); // Complete the verification process - function completeVerification() { - verifyCheckbox.checked = true; - checkMark.style.display = 'inline'; - verificationText.style.display = 'inline'; - loadingText.style.display = 'none'; - errorMessage.style.display = 'none'; - // Enable the submit button if it exists - if (submitButton) { - submitButton.disabled = false; - } - } +function completeVerification() { + verifyCheckbox.style.display = 'none'; // Hide the checkbox + captchaLabel.style.display = 'none'; // Hide the label text + checkMark.style.display = 'inline'; + verificationText.style.display = 'inline'; + loadingText.style.display = 'none'; + errorMessage.style.display = 'none'; + // Enable the submit button if it exists + if (submitButton) { + submitButton.disabled = false; + } +} // Event listener for the verify checkbox - verifyCheckbox.addEventListener('change', function() { - if (verifyCheckbox.checked) { - captchaLabel.style.display = 'none'; // 隐藏标签 - verifyCheckbox.style.display = 'none'; // 隐藏复选框 - loadingText.style.display = 'inline'; // 显示加载文本 - - // 模拟异步请求 (你可以在这里添加实际的验证逻辑) - setTimeout(function() { - loadingText.style.display = 'none'; // 隐藏加载文本 - - // 生成并显示验证成功的 SVG 图标 - const successIcon = document.createElement('img'); - successIcon.id = 'success-icon'; - successIcon.src = 'https://captcha.xyehr.cn/assets/check-mark.svg' + verifyCheckbox.addEventListener('change', () => { + if (verifyCheckbox.checked) { + showMathCaptcha(); + verifyCheckbox.checked = false; + } + }); // Add mouse movement listener if not a touch device if (!isTouchDevice) {