MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / handleSaveEmailCode

Function handleSaveEmailCode

static/js/settings.js:619–646  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

617
618// 保存验证码等待配置
619async function handleSaveEmailCode(e) {
620 e.preventDefault();
621
622 const timeout = parseInt(document.getElementById('email-code-timeout').value);
623 const pollInterval = parseInt(document.getElementById('email-code-poll-interval').value);
624
625 // 客户端验证
626 if (timeout < 30 || timeout > 600) {
627 toast.error('等待超时必须在 30-600 秒之间');
628 return;
629 }
630 if (pollInterval < 1 || pollInterval > 30) {
631 toast.error('轮询间隔必须在 1-30 秒之间');
632 return;
633 }
634
635 const data = {
636 timeout: timeout,
637 poll_interval: pollInterval
638 };
639
640 try {
641 await api.post('/settings/email-code', data);
642 toast.success('验证码配置已保存');
643 } catch (error) {
644 toast.error('保存失败: ' + error.message);
645 }
646}
647
648// 备份数据库
649async function handleBackup() {

Callers

nothing calls this directly

Calls 3

errorMethod · 0.80
successMethod · 0.80
postMethod · 0.45

Tested by

no test coverage detected