From d68feae1cf36dec102b51f379b2216e00d25243b Mon Sep 17 00:00:00 2001 From: jiohjung98 Date: Thu, 16 May 2024 16:18:12 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EC=9D=B8=EC=A6=9D=EC=BD=94=EB=93=9C?= =?UTF-8?q?=20type=20number=20->=20string=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/findpassword/EmailCertification.tsx | 4 ++-- src/components/signup/EmailVerification.tsx | 4 ++-- src/components/signup/PhoneCertification.tsx | 9 +++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/findpassword/EmailCertification.tsx b/src/components/findpassword/EmailCertification.tsx index 6b61aeb..6b9749c 100644 --- a/src/components/findpassword/EmailCertification.tsx +++ b/src/components/findpassword/EmailCertification.tsx @@ -28,7 +28,7 @@ const EmailCertification = ({ setStep }: EmailCertificationProps) => { }); const { mutateAsync: emailVerify } = useMutation( - ({ emailAddress, code }: { emailAddress: string; code: number }) => { + ({ emailAddress, code }: { emailAddress: string; code: string }) => { return emailauthverify({ emailAddress, code }); } ); @@ -117,7 +117,7 @@ const EmailCertification = ({ setStep }: EmailCertificationProps) => { try { const { status } = (await emailVerify({ emailAddress: userEmail, - code: Number(validNumber) + code: validNumber })) as { status: string }; if (status == 'SUCCESS') { diff --git a/src/components/signup/EmailVerification.tsx b/src/components/signup/EmailVerification.tsx index d6ac11a..7e3cde5 100644 --- a/src/components/signup/EmailVerification.tsx +++ b/src/components/signup/EmailVerification.tsx @@ -31,7 +31,7 @@ const EmailVerification = ({ onNext }: EmailVerification) => { }); const { mutateAsync: emailVerify } = useMutation( - ({ emailAddress, code }: { emailAddress: string; code: number }) => { + ({ emailAddress, code }: { emailAddress: string; code: string }) => { return emailauthverify({ emailAddress, code }); } ); @@ -80,7 +80,7 @@ const EmailVerification = ({ onNext }: EmailVerification) => { try { const { status } = (await emailVerify({ emailAddress: userEmail, - code: Number(validNumber) + code: validNumber })) as { status: string }; if (status == 'SUCCESS') { diff --git a/src/components/signup/PhoneCertification.tsx b/src/components/signup/PhoneCertification.tsx index b1a30fe..5a96f0c 100644 --- a/src/components/signup/PhoneCertification.tsx +++ b/src/components/signup/PhoneCertification.tsx @@ -30,7 +30,7 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => { }); const { mutateAsync: phoneVerify } = useMutation( - ({ phoneNumber, code }: { phoneNumber: string; code: number }) => { + ({ phoneNumber, code }: { phoneNumber: string; code:string }) => { return phoneauthverify({ phoneNumber, code }); } ); @@ -114,6 +114,8 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => { if (btnStatus == 'THIRD') { if (validNumber.length != 6) { + console.log(validNumber) + setValidNumber(''); setErrorMessage('6자리 코드를 입력해주세요.'); inputRef.current?.focus(); @@ -122,7 +124,7 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => { try { const { status } = await phoneVerify({ phoneNumber: phoneNumber.replace(/-/g, ''), - code: Number(validNumber) + code: validNumber }); if (status == 'SUCCESS') { @@ -134,6 +136,9 @@ const PhoneCertification = ({ onNext }: PhoneCertificationProps) => { const select = signError.find((item) => item.errorCode === errorCode); if (select) { setErrorMessage(select.message); + console.log(validNumber); + console.log(parseInt(validNumber, 10)); + console.log(Number(validNumber)); setValidNumber(''); inputRef.current?.focus(); return; From 05563e20d45e699c43114c95f57e72920253f8b1 Mon Sep 17 00:00:00 2001 From: jiohjung98 Date: Thu, 16 May 2024 16:23:16 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20IPhoneAuth=20code=20type=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/types/auth.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/types/auth.ts b/src/api/types/auth.ts index 3859a66..6cb7d89 100644 --- a/src/api/types/auth.ts +++ b/src/api/types/auth.ts @@ -24,7 +24,7 @@ export interface IPhoneNumber { } export interface IPhoneAuth extends IPhoneNumber { - code: number; + code: string; } export interface IUserInfo { @@ -43,12 +43,12 @@ export interface IEmail { emailAddress: string; } export interface IEmailAuth extends IEmail { - code: number; + code: string; } export interface IEmailAuth2 { emailAddress: string; - code: number; + code: string; } export interface ITokenRefresh {