diff --git a/apps/web/src/components/auth/BindContactModal/hooks/useBindContactForm.ts b/apps/web/src/components/auth/BindContactModal/hooks/useBindContactForm.ts index 5aad42154..16ce271c3 100644 --- a/apps/web/src/components/auth/BindContactModal/hooks/useBindContactForm.ts +++ b/apps/web/src/components/auth/BindContactModal/hooks/useBindContactForm.ts @@ -33,7 +33,8 @@ export const useBindContactForm = ({ open, onSuccess }: UseBindContactFormOption /* ── 发送验证码 ── */ const handleSendCode = async () => { try { - const value = form.getFieldValue(activeTab === "email" ? "email" : "phone") + const fieldName = activeTab === "email" ? "email" : "phone" + const value = form.getFieldValue(fieldName) if (!value) { message.warning(activeTab === "email" ? "请输入邮箱" : "请输入手机号") return @@ -68,8 +69,8 @@ export const useBindContactForm = ({ open, onSuccess }: UseBindContactFormOption try { const payload = activeTab === "email" - ? { email: values.email, email_code: values.code } - : { phone: values.phone, phone_code: values.code } + ? { email: values.email, email_code: values.email_code } + : { phone: values.phone, phone_code: values.phone_code } const result = await bindContact(payload)