fix: 发送验证码

This commit is contained in:
speakeloudest 2025-09-01 07:40:01 -07:00
parent 2862629516
commit d01a381f9d
2 changed files with 8 additions and 8 deletions

View File

@ -32,10 +32,10 @@ export default function SendCode({ type, params, form }: SendCodeProps) {
// Use form.getValues() to get the latest form data
const latestValues = form.getValues();
console.log(11111, latestValues);
if (latestValues.email && latestValues.type) {
if (latestValues.email && params.type) {
await sendEmailCode({
email: latestValues.email,
type: latestValues.type,
type: params.type,
});
setTargetDate(Date.now() + 60000);
}
@ -44,11 +44,11 @@ export default function SendCode({ type, params, form }: SendCodeProps) {
const getPhoneCode = async () => {
// Use form.getValues() to get the latest form data
const latestValues = form.getValues();
if (latestValues.telephone && latestValues.telephone_area_code && latestValues.type) {
if (latestValues.telephone && latestValues.telephone_area_code && params.type) {
await sendSmsCode({
telephone: latestValues.telephone,
telephone_area_code: latestValues.telephone_area_code,
type: latestValues.type,
type: params.type,
});
setTargetDate(Date.now() + 60000);
}

View File

@ -53,10 +53,10 @@ export default function SendCode({ type, params, form }: SendCodeProps) {
const getEmailCode = async () => {
// Use form.getValues() to get the latest form data
const latestValues = form.getValues();
if (latestValues.email && latestValues.type) {
if (latestValues.email && params.type) {
await sendEmailCode({
email: latestValues.email,
type: latestValues.type,
type: params.type,
});
setCodeTimer();
}
@ -65,11 +65,11 @@ export default function SendCode({ type, params, form }: SendCodeProps) {
const getPhoneCode = async () => {
// Use form.getValues() to get the latest form data
const latestValues = form.getValues();
if (latestValues.telephone && latestValues.telephone_area_code && latestValues.type) {
if (latestValues.telephone && latestValues.telephone_area_code && params.type) {
await sendSmsCode({
telephone: latestValues.telephone,
telephone_area_code: latestValues.telephone_area_code,
type: latestValues.type,
type: params.type,
});
setCodeTimer();
}