Skip to content

Commit

Permalink
Update api2.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev.Huang authored Jul 4, 2024
1 parent ff1a37f commit f4b8983
Showing 1 changed file with 18 additions and 25 deletions.
43 changes: 18 additions & 25 deletions captcha/v1/api2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f4b8983

Please sign in to comment.