|
@@ -155,10 +155,11 @@ const { loading: searching, send: search } = useRequest((data) => searchAccountM
|
|
|
modelRef.value = { ...modelRef.value, ...data };
|
|
|
});
|
|
|
|
|
|
+let captchaLoaded = false;
|
|
|
const { loading: captchaLoading, countdown, send: getCaptcha } = useCaptcha(
|
|
|
() => getCaptchaMethod(modelRef.value.phone!),
|
|
|
{ initialCountdown: 60 },
|
|
|
-);
|
|
|
+).onSuccess(() => captchaLoaded = true);
|
|
|
const getCaptchaHandle = async () => {
|
|
|
try {
|
|
|
await formRef.value?.validate('phone');
|
|
@@ -180,7 +181,7 @@ const searchHandle = async (key: 'cardno' | 'code') => {
|
|
|
};
|
|
|
|
|
|
function onKeyboardBlur(field: Field & { name: FieldKey }) {
|
|
|
- if ( field?.name === 'phone' ) { getCaptchaHandle(); }
|
|
|
+ if ( field?.name === 'phone' && !captchaLoaded ) { getCaptchaHandle(); }
|
|
|
if ( field?.name === 'cardno' ) { searchHandle('cardno'); }
|
|
|
if ( field?.name === 'code' ) { searchHandle('code'); }
|
|
|
}
|