(e)
| 80 | } |
| 81 | |
| 82 | async function handleSubmit(e) { |
| 83 | if (!email) { |
| 84 | showError(t('请输入邮箱地址')); |
| 85 | return; |
| 86 | } |
| 87 | if (turnstileEnabled && turnstileToken === '') { |
| 88 | showInfo(t('请稍后几秒重试,Turnstile 正在检查用户环境!')); |
| 89 | return; |
| 90 | } |
| 91 | setDisableButton(true); |
| 92 | setLoading(true); |
| 93 | const res = await API.get( |
| 94 | `/api/reset_password?email=${email}&turnstile=${turnstileToken}`, |
| 95 | ); |
| 96 | const { success, message } = res.data; |
| 97 | if (success) { |
| 98 | showSuccess(t('重置邮件发送成功,请检查邮箱!')); |
| 99 | setInputs({ ...inputs, email: '' }); |
| 100 | } else { |
| 101 | showError(message); |
| 102 | } |
| 103 | setLoading(false); |
| 104 | } |
| 105 | |
| 106 | return ( |
| 107 | <div className='classic-page-fill relative overflow-hidden bg-gray-100 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8'> |
nothing calls this directly
no test coverage detected