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
|
||||
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);
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user