fix: 发送验证码
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user