| 596 | |
| 597 | // 保存注册配置 |
| 598 | async function handleSaveRegistration(e) { |
| 599 | e.preventDefault(); |
| 600 | |
| 601 | const data = { |
| 602 | max_retries: parseInt(document.getElementById('max-retries').value), |
| 603 | timeout: parseInt(document.getElementById('timeout').value), |
| 604 | default_password_length: parseInt(document.getElementById('password-length').value), |
| 605 | entry_flow: document.getElementById('registration-entry-flow').value || 'native', |
| 606 | sleep_min: parseInt(document.getElementById('sleep-min').value), |
| 607 | sleep_max: parseInt(document.getElementById('sleep-max').value), |
| 608 | }; |
| 609 | |
| 610 | try { |
| 611 | await api.post('/settings/registration', data); |
| 612 | toast.success('注册配置已保存'); |
| 613 | } catch (error) { |
| 614 | toast.error('保存失败: ' + error.message); |
| 615 | } |
| 616 | } |
| 617 | |
| 618 | // 保存验证码等待配置 |
| 619 | async function handleSaveEmailCode(e) { |