完成页面签到一致性以及手机验证
This commit is contained in:
@@ -1076,6 +1076,9 @@
|
|||||||
let count = 60;
|
let count = 60;
|
||||||
const originalText = "发送验证码";
|
const originalText = "发送验证码";
|
||||||
|
|
||||||
|
// Show loading state
|
||||||
|
btn.innerHTML = '<span class="loader" style="width: 14px; height: 14px; border-width: 2px; margin-right: 5px;"></span> 发送中...';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch('/api/send-sms', {
|
const res = await fetch('/api/send-sms', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -1099,11 +1102,13 @@
|
|||||||
errorDiv.textContent = data.message || '发送失败';
|
errorDiv.textContent = data.message || '发送失败';
|
||||||
errorDiv.classList.remove('hidden');
|
errorDiv.classList.remove('hidden');
|
||||||
btn.disabled = false;
|
btn.disabled = false;
|
||||||
|
btn.innerText = originalText;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
errorDiv.textContent = '网络错误';
|
errorDiv.textContent = '网络错误';
|
||||||
errorDiv.classList.remove('hidden');
|
errorDiv.classList.remove('hidden');
|
||||||
btn.disabled = false;
|
btn.disabled = false;
|
||||||
|
btn.innerText = originalText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user