Commit c641da4b by zhangleyuan

feat:修改滑块验证码的默认显示问题

parent 9f0fc619
......@@ -7,7 +7,12 @@ import CheckBeforeSendCode from '@/components/CheckBeforeSendCode';
interface changePhoneModalProps {
onClose:() => void,
onConfirm:any
onConfirm:any,
}
interface checkObjectType {
reset:() => void
}
function ChangePhoneModal(props: changePhoneModalProps) {
......@@ -20,7 +25,7 @@ function ChangePhoneModal(props: changePhoneModalProps) {
const [phoneVerifyError,setPhoneVerifyError] = useState(false);
const [errorMessageText,setErrorMessageText] = useState('');
const [openCheck, setOpenCheck] = useState(false); //滑块验证是否是打开状态
const [checkObject, setCheckObject] = useState({});
const [checkObject, setCheckObject] = useState<checkObjectType|undefined>();
useEffect(() => {
})
......@@ -39,7 +44,7 @@ function ChangePhoneModal(props: changePhoneModalProps) {
setNewPhoneError(true);
return;
}
!_.isEmpty(checkObject) && checkObject.reset();
!_.isEmpty(checkObject) && checkObject && checkObject.reset();
setOpenCheck(true);
}
function handleSendSMSCode(checkData:any){
......
......@@ -9,6 +9,9 @@ interface IdentificationModalProps {
phone:String,
onConfirm:() => void
}
interface checkObjectType {
reset:() => void
}
function IdentificationModal(props: IdentificationModalProps) {
const {onClose, phone ,onConfirm} = props;
......@@ -19,7 +22,7 @@ function IdentificationModal(props: IdentificationModalProps) {
const [errorMessageText,setErrorMessageText] = useState('');
const [openCheck, setOpenCheck] = useState(false); //滑块验证是否是打开状态
const [checkObject, setCheckObject] = useState({});
const [checkObject, setCheckObject] = useState<checkObjectType|undefined>();
useEffect(() => {
})
......@@ -76,7 +79,7 @@ function IdentificationModal(props: IdentificationModalProps) {
}
function checkSend() {
if (waitStatus) return;
!_.isEmpty(checkObject) && checkObject.reset();
!_.isEmpty(checkObject) && checkObject && checkObject.reset();
setOpenCheck(true);
}
return (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment