MCPcopy
hub / github.com/QuantumNous/new-api / handleSubmit

Function handleSubmit

web/classic/src/components/auth/PasswordResetForm.jsx:82–104  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

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'>

Callers

nothing calls this directly

Calls 3

showErrorFunction · 0.90
showInfoFunction · 0.90
showSuccessFunction · 0.90

Tested by

no test coverage detected