()
| 277 | }; |
| 278 | |
| 279 | const sendVerificationCode = async () => { |
| 280 | if (inputs.email === '') { |
| 281 | showError(t('请输入邮箱!')); |
| 282 | return; |
| 283 | } |
| 284 | setDisableButton(true); |
| 285 | if (turnstileEnabled && turnstileToken === '') { |
| 286 | showInfo(t('请稍后几秒重试,Turnstile 正在检查用户环境!')); |
| 287 | return; |
| 288 | } |
| 289 | setLoading(true); |
| 290 | const res = await API.get( |
| 291 | `/api/verification?email=${inputs.email}&turnstile=${turnstileToken}`, |
| 292 | ); |
| 293 | const { success, message } = res.data; |
| 294 | if (success) { |
| 295 | showSuccess(t('验证码发送成功,请检查邮箱!')); |
| 296 | } else { |
| 297 | showError(message); |
| 298 | } |
| 299 | setLoading(false); |
| 300 | }; |
| 301 | |
| 302 | const bindEmail = async () => { |
| 303 | if (inputs.email_verification_code === '') { |
nothing calls this directly
no test coverage detected