From f4b8983ba2f380ab4bc48d3edf0222f3b16185e1 Mon Sep 17 00:00:00 2001 From: "Dev.Huang" <18778418865@163.com> Date: Thu, 4 Jul 2024 21:16:57 +0800 Subject: [PATCH] Update api2.js --- captcha/v1/api2.js | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) 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) {