|
|
|
@ -22,7 +22,7 @@ import {
|
|
|
|
|
updateUserPw |
|
|
|
|
} from '@src/_redux/features/account/find/findThunk'; |
|
|
|
|
import { openModal } from '@src/_redux/features/comn/message/messageSlice'; |
|
|
|
|
import { MODAL_CRTFYHP, MODAL_DESC, MODAL_TITLE } from '@src/configs/msgConst'; |
|
|
|
|
import { MODAL_CRTFYHP, MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; |
|
|
|
|
|
|
|
|
|
export const AccountFindPassword = props => { |
|
|
|
|
const dispatch = useDispatch(); |
|
|
|
@ -73,22 +73,28 @@ export const AccountFindPassword = props => {
|
|
|
|
|
|
|
|
|
|
const handlerSend = async () => { |
|
|
|
|
if (!inputId) { |
|
|
|
|
handlerOpenModal(MODAL_TITLE.crtfyhp, '아이디를' + MODAL_DESC.valid); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.crtfyhp, '아이디를' + MODAL_BODY.valid); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!inputHpno) { |
|
|
|
|
handlerOpenModal(MODAL_TITLE.crtfyhp, '휴대폰 번호를' + MODAL_DESC.valid); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
MODAL_HEADER.crtfyhp, |
|
|
|
|
'휴대폰 번호를' + MODAL_BODY.valid |
|
|
|
|
); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (inputHpno.length < 11) { |
|
|
|
|
handlerOpenModal(MODAL_TITLE.crtfyhp, '올바른 번호를' + MODAL_DESC.valid); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
MODAL_HEADER.crtfyhp, |
|
|
|
|
'올바른 번호를' + MODAL_BODY.valid |
|
|
|
|
); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (sendCount >= 3) { |
|
|
|
|
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.count); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.count); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -98,11 +104,11 @@ export const AccountFindPassword = props => {
|
|
|
|
|
|
|
|
|
|
if (data.code === -1) { |
|
|
|
|
handlerOpenModal( |
|
|
|
|
MODAL_TITLE.crtfyhp, |
|
|
|
|
MODAL_HEADER.crtfyhp, |
|
|
|
|
'가입되지 않은 회원정보입니다. 다시 확인해주세요.' |
|
|
|
|
); |
|
|
|
|
} else if (data.code === 0) { |
|
|
|
|
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.send); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.send); |
|
|
|
|
timeStart(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
@ -137,7 +143,7 @@ export const AccountFindPassword = props => {
|
|
|
|
|
setIsRunning(false); |
|
|
|
|
// setValue('crtfyNo', '');
|
|
|
|
|
// setCrtfyNo('');
|
|
|
|
|
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.expire); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.expire); |
|
|
|
|
} |
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
|
@ -154,17 +160,20 @@ export const AccountFindPassword = props => {
|
|
|
|
|
confirm: '인증번호 인증' |
|
|
|
|
}; |
|
|
|
|
if (!inputId) { |
|
|
|
|
handlerOpenModal(MODAL_TITLE.crtfyhp, '아이디를' + MODAL_DESC.valid); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.crtfyhp, '아이디를' + MODAL_BODY.valid); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!inputHpno) { |
|
|
|
|
handlerOpenModal(MODAL_TITLE.crtfyhp, '휴대폰 번호를' + MODAL_DESC.valid); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
MODAL_HEADER.crtfyhp, |
|
|
|
|
'휴대폰 번호를' + MODAL_BODY.valid |
|
|
|
|
); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!inputCrtfy) { |
|
|
|
|
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.valid); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.valid); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -174,10 +183,10 @@ export const AccountFindPassword = props => {
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (!data.result) { |
|
|
|
|
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.failed); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.failed); |
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
|
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.confirm); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.confirm); |
|
|
|
|
setIsCrtfy(true); |
|
|
|
|
setIsRunning(false); |
|
|
|
|
} |
|
|
|
@ -186,7 +195,7 @@ export const AccountFindPassword = props => {
|
|
|
|
|
const handlerUpdatePw = async () => { |
|
|
|
|
const modalHeader = '비밀번호 변경'; |
|
|
|
|
if (!inputNewPw || !inputNewPwCk) { |
|
|
|
|
handlerOpenModal(modalHeader, '비밀번호를' + MODAL_DESC.valid); |
|
|
|
|
handlerOpenModal(modalHeader, '비밀번호를' + MODAL_BODY.valid); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|