From 0076498ea838208c3811c9b8d9ab0fdacb99604a Mon Sep 17 00:00:00 2001 From: jiohjung98 Date: Wed, 9 Oct 2024 14:26:46 +0900 Subject: [PATCH] =?UTF-8?q?remove:=20console=20log=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/mypage/edit/changephone/page.tsx | 20 ++++----- src/app/mypage/edit/page.tsx | 1 - src/app/page.tsx | 2 - .../payment/check/confirm/success/page.tsx | 4 -- src/app/signup/page.tsx | 6 +-- src/components/education/RoadMapItem.tsx | 1 - src/components/find/FindEmail.tsx | 25 +++++------ src/components/find/FindPassword.tsx | 11 ++--- .../practice/CategoryPracticeItem.tsx | 3 -- .../CategorySubloadmapBottomArticle.tsx | 1 - src/components/product/Dividend.tsx | 2 - .../product/ProductClassification.tsx | 1 - src/components/recentlyIssue/BestNews.tsx | 2 - src/components/signup/Step4.tsx | 1 - .../signup/modal/PhoneVerification.tsx | 45 +++++++++---------- src/factory/ReportIssue.ts | 1 - src/factory/ReportLists.ts | 3 -- src/factory/useNewsList.ts | 1 - src/service/auth.ts | 15 ------- src/service/change.ts | 4 -- src/utils/localStorage.ts | 3 -- 21 files changed, 44 insertions(+), 108 deletions(-) diff --git a/src/app/mypage/edit/changephone/page.tsx b/src/app/mypage/edit/changephone/page.tsx index c527994..038dd3f 100644 --- a/src/app/mypage/edit/changephone/page.tsx +++ b/src/app/mypage/edit/changephone/page.tsx @@ -38,12 +38,10 @@ const ChangePhonePage = () => { const handleRequest = async () => { try { const data = await sendVerificationCode(phoneNumber); - console.log('인증 요청 성공:', data); - setIsRequest(true); // 요청 상태 true - setValidTime(300); // 인증 요청 시 타이머 초기화 + setIsRequest(true); + setValidTime(300); } catch (error) { - console.error('인증 요청 실패:', error); - setIsRequest(false); // 요청 실패 시 상태 초기화 + setIsRequest(false); } }; @@ -51,26 +49,24 @@ const ChangePhonePage = () => { if (isComplete) return; try { const data = await sendVerificationCode(phoneNumber); - console.log('인증 재요청 성공:', data); setValidNumber(''); inputRef.current?.focus(); - setIsRequest(true); // 요청 상태 true - setValidTime(300); // 인증 요청 시 타이머 초기화 + setIsRequest(true); + setValidTime(300); } catch (error) { console.error('인증 재요청 실패:', error); } }; const handleCertify = async () => { - if (isComplete) return; // 이미 인증 완료된 상태면 return + if (isComplete) return; try { const data = await verifyCode(phoneNumber, validNumber); - console.log('인증 완료:', data); - setIsComplete(true); // 인증 검사 통과 + setIsComplete(true); setIsError(false); } catch (error) { console.error('인증 실패:', error); - setIsError(true); // 인증 검사 실패 + setIsError(true); } }; diff --git a/src/app/mypage/edit/page.tsx b/src/app/mypage/edit/page.tsx index 9da9759..0c646c3 100644 --- a/src/app/mypage/edit/page.tsx +++ b/src/app/mypage/edit/page.tsx @@ -30,7 +30,6 @@ const Editpage = () => { const checkNameDuplicate = async () => { try { const response = await checkNicknameAvailability(nameValue); - console.log(response) if (response) { setIsNameComplete('yes'); } else { diff --git a/src/app/page.tsx b/src/app/page.tsx index fa86a0f..082cc11 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -25,8 +25,6 @@ const HomePage = () => { const user = JSON.parse(parsedUser.user); setCookie('access_token', accessToken); - - console.log('유저 정보', user); setMember({ memberEmail: user.email, memberNickName: user.nickname, diff --git a/src/app/payment/check/confirm/success/page.tsx b/src/app/payment/check/confirm/success/page.tsx index d230914..7fc7c6f 100644 --- a/src/app/payment/check/confirm/success/page.tsx +++ b/src/app/payment/check/confirm/success/page.tsx @@ -76,10 +76,6 @@ async function getPayment({ paymentKey, orderId, amount }: PaymentRequestProps) } ); - if (payment) { - console.log(payment); - } - return { payment: payment }; diff --git a/src/app/signup/page.tsx b/src/app/signup/page.tsx index 1270ede..2d2adbc 100644 --- a/src/app/signup/page.tsx +++ b/src/app/signup/page.tsx @@ -75,8 +75,6 @@ const SignupPage: React.FC = () => { const handleSubmit = async () => { try { - console.log('최종 제출 데이터:', formData); - const accessToken = getCookie('access_token'); if (!accessToken) { @@ -88,9 +86,7 @@ const SignupPage: React.FC = () => { Verify: accessToken, }; - const response = await finalSignup(formData, authHeaders); - console.log('서버 응답 데이터:', response); - + await finalSignup(formData, authHeaders); router.push('/'); } catch (error) { console.error('서버 요청 오류:', error); diff --git a/src/components/education/RoadMapItem.tsx b/src/components/education/RoadMapItem.tsx index 63b1c3a..b4846ad 100644 --- a/src/components/education/RoadMapItem.tsx +++ b/src/components/education/RoadMapItem.tsx @@ -21,7 +21,6 @@ const RoadMapItem = ({ roadmap, setRoadmap }: RoadMapItemType) => { - console.log(subRoadmapData); return (
diff --git a/src/components/find/FindEmail.tsx b/src/components/find/FindEmail.tsx index 2737939..ba1f918 100644 --- a/src/components/find/FindEmail.tsx +++ b/src/components/find/FindEmail.tsx @@ -36,40 +36,37 @@ const FindEmail = () => { const handleRequest = async () => { try { - const data = await sendVerificationCode(phoneNumber); - console.log('인증 요청 성공:', data); - setIsRequest(true); // 요청 상태 true - setValidTime(300); // 인증 요청 시 타이머 초기화 + await sendVerificationCode(phoneNumber); + setIsRequest(true); + setValidTime(300); } catch (error) { console.error('인증 요청 실패:', error); - setIsRequest(false); // 요청 실패 시 상태 초기화 + setIsRequest(false); } }; const handleResending = async () => { if (isComplete) return; try { - const data = await sendVerificationCode(phoneNumber); - console.log('인증 재요청 성공:', data); + await sendVerificationCode(phoneNumber); setValidNumber(''); inputRef.current?.focus(); - setIsRequest(true); // 요청 상태 true - setValidTime(300); // 인증 요청 시 타이머 초기화 + setIsRequest(true); + setValidTime(300); } catch (error) { console.error('인증 재요청 실패:', error); } }; const handleCertify = async () => { - if (isComplete) return; // 이미 인증 완료된 상태면 return + if (isComplete) return; try { - const data = await verifyCode(phoneNumber, validNumber); - console.log('인증 완료:', data); - setIsComplete(true); // 인증 검사 통과 + await verifyCode(phoneNumber, validNumber); + setIsComplete(true); setIsError(false); } catch (error) { console.error('인증 실패:', error); - setIsError(true); // 인증 검사 실패 + setIsError(true); } }; diff --git a/src/components/find/FindPassword.tsx b/src/components/find/FindPassword.tsx index 3a9662a..c0cfc25 100644 --- a/src/components/find/FindPassword.tsx +++ b/src/components/find/FindPassword.tsx @@ -30,10 +30,8 @@ const FindPassword = () => { }; const handleRequest = async () => { - console.log('요청함'); try { - const data = await sendEmail(email); - console.log('인증 요청 성공:', data); + await sendEmail(email); setIsRequest(true); setValidTime(300); } catch (error) { @@ -45,8 +43,7 @@ const FindPassword = () => { const handleResending = async () => { if (isComplete) return; try { - const data = await sendEmail(email); - console.log('인증 재요청 성공:', data); + await sendEmail(email); setVerificationCode(''); inputRef.current?.focus(); setIsRequest(true); @@ -59,8 +56,7 @@ const FindPassword = () => { const handleCertify = async () => { if (isComplete) return; try { - const data = await verifyEmailCode(email, verificationCode); - console.log('인증 완료:', data); + await verifyEmailCode(email, verificationCode); setIsComplete(true); setIsError(false); } catch (error) { @@ -119,7 +115,6 @@ const FindPassword = () => { if (passwordMatch && passwordValid) { try { await changePasswordinFind(email, password); - console.log('비밀번호 재설정 성공'); } catch (error) { console.error('비밀번호 재설정 실패:', error); } diff --git a/src/components/practice/CategoryPracticeItem.tsx b/src/components/practice/CategoryPracticeItem.tsx index 5a489d2..1fa2642 100644 --- a/src/components/practice/CategoryPracticeItem.tsx +++ b/src/components/practice/CategoryPracticeItem.tsx @@ -1,12 +1,9 @@ import type { StudyGuidesItem, SubLoadmap } from '@/types/homeComponentsType'; import React from 'react'; -import { useRouter } from 'next/navigation'; const CategoryPracticeItem = ({ id, title, link }: StudyGuidesItem) => { - const router = useRouter(); const handleClick = () => { - console.log(link); window.open(link, '_blank'); }; diff --git a/src/components/practice/CategorySubloadmapBottomArticle.tsx b/src/components/practice/CategorySubloadmapBottomArticle.tsx index 8c62f21..e6da10b 100644 --- a/src/components/practice/CategorySubloadmapBottomArticle.tsx +++ b/src/components/practice/CategorySubloadmapBottomArticle.tsx @@ -5,7 +5,6 @@ import Image from 'next/image'; const CategorySubloadmapBottomArticle: React.FC = ({ id, title, description, date, imageLink, link }) => { const handleClick = () => { - console.log(link); window.open(link, '_blank'); }; diff --git a/src/components/product/Dividend.tsx b/src/components/product/Dividend.tsx index c16c5e6..652f2cb 100644 --- a/src/components/product/Dividend.tsx +++ b/src/components/product/Dividend.tsx @@ -5,7 +5,6 @@ import SwiperCore from 'swiper'; import 'swiper/css'; import 'swiper/css/navigation'; import 'swiper/css/pagination'; -// import SwiperCore, { Navigation } from 'swiper/core'; import Image from 'next/image'; import { memo, useState } from 'react'; import { IDivide } from '@/types/Diviend'; @@ -71,7 +70,6 @@ const Dividend = memo(({ dividend }: DividendProps) => { }} className="mySwiper flex justify-center"> {dividend?.map((item) => { - console.log(item?.product_Id); return (
diff --git a/src/components/product/ProductClassification.tsx b/src/components/product/ProductClassification.tsx index 894acc8..aa89687 100644 --- a/src/components/product/ProductClassification.tsx +++ b/src/components/product/ProductClassification.tsx @@ -16,7 +16,6 @@ const ProductClassification = ({ const params = new URLSearchParams(searchParams.toString()); const router = useRouter(); const sorted = searchParams.get('subcategory'); - console.log(sorted); const handleClick = (key: string, key2: string) => { params.set('subcategory', key); diff --git a/src/components/recentlyIssue/BestNews.tsx b/src/components/recentlyIssue/BestNews.tsx index 6311a55..99a0955 100644 --- a/src/components/recentlyIssue/BestNews.tsx +++ b/src/components/recentlyIssue/BestNews.tsx @@ -13,8 +13,6 @@ import { Pagination, Autoplay } from 'swiper/modules'; const BestNews = () => { const { data, isLoading } = getRecentlyIssues(); - console.log('최신뉴스', data); - return (
👀 오늘 가장 많이 본 뉴스
diff --git a/src/components/signup/Step4.tsx b/src/components/signup/Step4.tsx index 991114a..7238d18 100644 --- a/src/components/signup/Step4.tsx +++ b/src/components/signup/Step4.tsx @@ -93,7 +93,6 @@ const Step4: React.FC = ({ onNext, onUpdate }) => { if (isFormValid) { try { await onNext(); - console.log('가입성공'); router.push('/sign'); } catch (error) { console.error('가입 처리 중 오류 발생:', error); diff --git a/src/components/signup/modal/PhoneVerification.tsx b/src/components/signup/modal/PhoneVerification.tsx index be0e787..931e26b 100644 --- a/src/components/signup/modal/PhoneVerification.tsx +++ b/src/components/signup/modal/PhoneVerification.tsx @@ -10,14 +10,14 @@ interface PhoneVerificationProps { } const PhoneVerification: React.FC = ({ onNext, onPhoneNumberChange }) => { - const [phoneNumber, setPhoneNumber] = useState(''); // 전화번호 - const [phoneNumberValid, setPhoneNumberValid] = useState(false); // 전화번호 유효성 검사 - const [isRequest, setIsRequest] = useState(false); // 전화번호 입력 후 인증요청 상태 - const [validNumber, setValidNumber] = useState(''); // 인증번호 - const [validNumberOk, setValidNumberOk] = useState(false); // 인증번호 유효성 검사 - const [isComplete, setIsComplete] = useState(false); // 인증번호 인증 성공 - const [isError, setIsError] = useState(false); // 인증번호 인증 실패 - const [validTime, setValidTime] = useState(300); // 인증 시간 + const [phoneNumber, setPhoneNumber] = useState(''); + const [phoneNumberValid, setPhoneNumberValid] = useState(false); + const [isRequest, setIsRequest] = useState(false); + const [validNumber, setValidNumber] = useState(''); + const [validNumberOk, setValidNumberOk] = useState(false); + const [isComplete, setIsComplete] = useState(false); + const [isError, setIsError] = useState(false); + const [validTime, setValidTime] = useState(300); const inputRef = useRef(null); const router = useRouter(); @@ -28,7 +28,7 @@ const PhoneVerification: React.FC = ({ onNext, onPhoneNu .replace(/^(\d{0,3})(\d{0,4})(\d{0,4})$/g, '$1-$2-$3') .replace(/(-{1,2})$/g, ''); setPhoneNumber(regex); - onPhoneNumberChange(regex); // 호출 추가 + onPhoneNumberChange(regex); }; const handleValidNumberChange = (e: ChangeEvent) => { @@ -39,13 +39,12 @@ const PhoneVerification: React.FC = ({ onNext, onPhoneNu const handleRequest = async () => { try { const plainPhoneNumber = phoneNumber.replace(/-/g, ''); - const data = await sendVerificationCode(plainPhoneNumber); - console.log('인증 요청 성공:', data); - setIsRequest(true); // 요청 상태 true - setValidTime(300); // 인증 요청 시 타이머 초기화 + await sendVerificationCode(plainPhoneNumber); + setIsRequest(true); + setValidTime(300); } catch (error) { console.error('인증 요청 실패:', error); - setIsRequest(false); // 요청 실패 시 상태 초기화 + setIsRequest(false); } }; @@ -53,34 +52,32 @@ const PhoneVerification: React.FC = ({ onNext, onPhoneNu if (isComplete) return; try { const plainPhoneNumber = phoneNumber.replace(/-/g, ''); - const data = await sendVerificationCode(plainPhoneNumber); - console.log('인증 재요청 성공:', data); + await sendVerificationCode(plainPhoneNumber); setValidNumber(''); inputRef.current?.focus(); - setIsRequest(true); // 요청 상태 true - setValidTime(300); // 인증 요청 시 타이머 초기화 + setIsRequest(true); + setValidTime(300); } catch (error) { console.error('인증 재요청 실패:', error); } }; const handleCertify = async () => { - if (isComplete) return; // 이미 인증 완료된 상태면 return + if (isComplete) return; try { const plainPhoneNumber = phoneNumber.replace(/-/g, ''); - const data = await verifyCode(plainPhoneNumber, validNumber); - console.log('인증 완료:', data); - setIsComplete(true); // 인증 검사 통과 + await verifyCode(plainPhoneNumber, validNumber); + setIsComplete(true); setIsError(false); } catch (error) { console.error('인증 실패:', error); - setIsError(true); // 인증 검사 실패 + setIsError(true); } }; const handleComplete = () => { if (isComplete) { - onNext(); // 인증 완료 후 다음 단계로 이동 + onNext(); } }; diff --git a/src/factory/ReportIssue.ts b/src/factory/ReportIssue.ts index 1051620..1fa30cd 100644 --- a/src/factory/ReportIssue.ts +++ b/src/factory/ReportIssue.ts @@ -4,7 +4,6 @@ import axios from 'axios'; const fetchReportIssues = async () => { const { data } = await axios.get(`https://api.moaguide.com/`); - console.log('최신이슈', data); return data; }; diff --git a/src/factory/ReportLists.ts b/src/factory/ReportLists.ts index ba0346a..c58a20f 100644 --- a/src/factory/ReportLists.ts +++ b/src/factory/ReportLists.ts @@ -38,8 +38,6 @@ export const getStudyGuides = (category: string, subCategory: string, sort: stri const fetchArticleList = async ({ pageParam = null }) => { const url = pageParam ? `https://api.moaguide.com/study/article?nextCursor=${pageParam}` : 'https://api.moaguide.com/study/article'; - console.log("Fetching next page with nextCursor:", pageParam); - const { data } = await axios.get(url); return { @@ -57,7 +55,6 @@ export const getArticles = () => { queryKey, queryFn: fetchArticleList, getNextPageParam: (lastPage) => { - console.log("Last page:", lastPage); return lastPage.isLast ? undefined : lastPage.nextPage; }, initialPageParam: null, diff --git a/src/factory/useNewsList.ts b/src/factory/useNewsList.ts index 2277026..792b5e4 100644 --- a/src/factory/useNewsList.ts +++ b/src/factory/useNewsList.ts @@ -10,7 +10,6 @@ const fetchNewsList = async ({ pageParam: number; }) => { const [, category] = queryKey; - console.log('category', category); const { data } = await axios.get( `https://api.moaguide.com/detail/news/${category}?page=${pageParam}&size=10` ); diff --git a/src/service/auth.ts b/src/service/auth.ts index 6c15af6..9e30574 100644 --- a/src/service/auth.ts +++ b/src/service/auth.ts @@ -6,7 +6,6 @@ import { axiosInstance, basicAxiosInstance, refreshAxiosInstance } from './axios // 토큰 사용하지 않는 API 함수들 export const sendVerificationCode = async (phone: string): Promise => { const response = await basicAxiosInstance.post('/signup/send/code', { phone }); - console.log(response.data); return response.data; }; @@ -17,9 +16,7 @@ export const verifyCode = async (phone: string, code: string): Promise { const response = await axiosInstance.post('/logout', {}); if (response.status === 200) { - console.log(response.data.message); removeToken(); const { clearMember } = useMemberStore.getState(); @@ -132,7 +121,6 @@ export const logout = async () => { export const sendEmail = async (email: string) => { try { const response = await basicAxiosInstance.post(`/user/send/mail?email=${email}`); - console.log('이메일 전송 성공:', response.data); return response.data; } catch (error) { console.error('이메일 전송 실패:', error); @@ -146,10 +134,8 @@ export const verifyEmailCode = async (email: string, code: string) => { email, code }); - console.log('인증 완료:', response.data); const token = response.headers['Verify'] || response.headers['verify']; - console.log('응답 토큰', token); setToken(token); return response.data; @@ -198,7 +184,6 @@ export const deleteUser = async () => { const response = await axiosInstance.delete('/user/Withdrawal'); if (response.status === 200) { - console.log(response.data.message); removeToken(); const { clearMember } = useMemberStore.getState(); diff --git a/src/service/change.ts b/src/service/change.ts index 9f32826..f05f274 100644 --- a/src/service/change.ts +++ b/src/service/change.ts @@ -5,7 +5,6 @@ export const updateNickname = async (nickname: string): Promise => { const response = await axiosInstance.patch('/user/update/nickname', { nickname }); if (response.status === 200) { - console.log('닉네임 수정 성공:', response.data); return true; } else { console.error('닉네임 수정 실패:', response.status); @@ -21,7 +20,6 @@ export const updateNickname = async (nickname: string): Promise => { export const checkPassword = async (password: string): Promise => { try { const response = await axiosInstance.post('/user/check/password', { password }); - console.log(response); return response.data; } catch (error) { console.error('비밀번호 검증 실패:', error); @@ -33,7 +31,6 @@ export const checkPassword = async (password: string): Promise => { export const changePassword = async (password: string): Promise => { try { const response = await axiosInstance.patch('/user/update/password', { password }); - console.log(response); return response.data; } catch (error) { console.error('비밀번호 변경 실패:', error); @@ -45,7 +42,6 @@ export const changePassword = async (password: string): Promise => { export const changePasswordinFind = async (email:string, password: string): Promise => { try { const response = await axiosInstance.patch('/user/update/password', { email, password }); - console.log(response); return response.data; } catch (error) { console.error('비밀번호 변경 실패:', error); diff --git a/src/utils/localStorage.ts b/src/utils/localStorage.ts index 67886e3..ca8a555 100644 --- a/src/utils/localStorage.ts +++ b/src/utils/localStorage.ts @@ -2,17 +2,14 @@ import { getCookie, removeCookie, setCookie } from "./cookie"; export const setToken = (token: string) => { - console.log('Saving token to cookie:', token); setCookie('access_token', token, { path: '/', secure: true, sameSite: 'strict' }); }; export const getToken = (): string | undefined => { const token = getCookie('access_token'); - console.log('Retrieved token from cookie:', token); return token; }; export const removeToken = () => { removeCookie('access_token', { path: '/' }); - console.log('Access token removed from cookie'); }; \ No newline at end of file