fix: 发送验证码
This commit is contained in:
parent
2862629516
commit
d01a381f9d
@ -32,10 +32,10 @@ export default function SendCode({ type, params, form }: SendCodeProps) {
|
|||||||
// Use form.getValues() to get the latest form data
|
// Use form.getValues() to get the latest form data
|
||||||
const latestValues = form.getValues();
|
const latestValues = form.getValues();
|
||||||
console.log(11111, latestValues);
|
console.log(11111, latestValues);
|
||||||
if (latestValues.email && latestValues.type) {
|
if (latestValues.email && params.type) {
|
||||||
await sendEmailCode({
|
await sendEmailCode({
|
||||||
email: latestValues.email,
|
email: latestValues.email,
|
||||||
type: latestValues.type,
|
type: params.type,
|
||||||
});
|
});
|
||||||
setTargetDate(Date.now() + 60000);
|
setTargetDate(Date.now() + 60000);
|
||||||
}
|
}
|
||||||
@ -44,11 +44,11 @@ export default function SendCode({ type, params, form }: SendCodeProps) {
|
|||||||
const getPhoneCode = async () => {
|
const getPhoneCode = async () => {
|
||||||
// Use form.getValues() to get the latest form data
|
// Use form.getValues() to get the latest form data
|
||||||
const latestValues = form.getValues();
|
const latestValues = form.getValues();
|
||||||
if (latestValues.telephone && latestValues.telephone_area_code && latestValues.type) {
|
if (latestValues.telephone && latestValues.telephone_area_code && params.type) {
|
||||||
await sendSmsCode({
|
await sendSmsCode({
|
||||||
telephone: latestValues.telephone,
|
telephone: latestValues.telephone,
|
||||||
telephone_area_code: latestValues.telephone_area_code,
|
telephone_area_code: latestValues.telephone_area_code,
|
||||||
type: latestValues.type,
|
type: params.type,
|
||||||
});
|
});
|
||||||
setTargetDate(Date.now() + 60000);
|
setTargetDate(Date.now() + 60000);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,10 +53,10 @@ export default function SendCode({ type, params, form }: SendCodeProps) {
|
|||||||
const getEmailCode = async () => {
|
const getEmailCode = async () => {
|
||||||
// Use form.getValues() to get the latest form data
|
// Use form.getValues() to get the latest form data
|
||||||
const latestValues = form.getValues();
|
const latestValues = form.getValues();
|
||||||
if (latestValues.email && latestValues.type) {
|
if (latestValues.email && params.type) {
|
||||||
await sendEmailCode({
|
await sendEmailCode({
|
||||||
email: latestValues.email,
|
email: latestValues.email,
|
||||||
type: latestValues.type,
|
type: params.type,
|
||||||
});
|
});
|
||||||
setCodeTimer();
|
setCodeTimer();
|
||||||
}
|
}
|
||||||
@ -65,11 +65,11 @@ export default function SendCode({ type, params, form }: SendCodeProps) {
|
|||||||
const getPhoneCode = async () => {
|
const getPhoneCode = async () => {
|
||||||
// Use form.getValues() to get the latest form data
|
// Use form.getValues() to get the latest form data
|
||||||
const latestValues = form.getValues();
|
const latestValues = form.getValues();
|
||||||
if (latestValues.telephone && latestValues.telephone_area_code && latestValues.type) {
|
if (latestValues.telephone && latestValues.telephone_area_code && params.type) {
|
||||||
await sendSmsCode({
|
await sendSmsCode({
|
||||||
telephone: latestValues.telephone,
|
telephone: latestValues.telephone,
|
||||||
telephone_area_code: latestValues.telephone_area_code,
|
telephone_area_code: latestValues.telephone_area_code,
|
||||||
type: latestValues.type,
|
type: params.type,
|
||||||
});
|
});
|
||||||
setCodeTimer();
|
setCodeTimer();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user