From f50adcb5760a56a192bdb6d0a4c95246cad5cb7e Mon Sep 17 00:00:00 2001 From: study2895 <144806675+study2895@users.noreply.github.com> Date: Wed, 11 Dec 2024 05:55:07 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[Style]=20=EB=A9=94=EC=9D=B8=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=A3=BC=EC=84=9D=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mainpage/MainpageView.vue | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/views/mainpage/MainpageView.vue b/src/views/mainpage/MainpageView.vue index f1724f9..6cc791c 100644 --- a/src/views/mainpage/MainpageView.vue +++ b/src/views/mainpage/MainpageView.vue @@ -111,7 +111,6 @@ import commentIcon from '@/assets/Icons/akoming/todo/comment.svg' import akofolioIcon from '@/assets/Icons/akoming/todo/akofolio.svg' import SkeletonMainPage from './SkeletonMainPage.vue' -// Tasks for the to-do list const tasks = ref([ { name: '아코밍 출석', completed: false }, { name: '아코자국', completed: false }, @@ -119,7 +118,6 @@ const tasks = ref([ { name: '아코폴리오', completed: false } ]) -// 스탬프 상태 정의 const stamps = ref([ { label: 'A', @@ -193,7 +191,6 @@ const fetchQuestStatus = async () => { } } -// Functions to get icons based on task name and completion status const getCompletedStampIcon = (label) => { return require(`@/assets/Icons/akoming/stamp/color/color${label.toLowerCase()}.svg`) } @@ -217,7 +214,6 @@ const getTaskIcon = (taskName) => { } } -// onMounted에서 호출하여 초기 데이터 로드 onMounted(() => { fetchQuestStatus() }) @@ -230,11 +226,11 @@ onMounted(() => { font-family: 'NanumSquareRound', sans-serif; display: flex; justify-content: center; - overflow-x: hidden; /* 좌우 스크롤 제거 */ + overflow-x: hidden; } .mobile-container { - width: 100%; /* 화면 크기에 맞게 조정 */ + width: 100%; max-width: 395px; min-width: 340px; background-color: #fae8da; From 93490b752018d91b20d2bce2d38ddcb90e0db832 Mon Sep 17 00:00:00 2001 From: study2895 <144806675+study2895@users.noreply.github.com> Date: Wed, 11 Dec 2024 06:10:50 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Feat]=20=EB=B9=84=EB=B0=80=EB=B2=88?= =?UTF-8?q?=ED=98=B8=20=EC=9E=85=EB=A0=A5=EB=90=9C=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=EA=B0=80=20=EC=97=86=EC=9D=84=20=EB=95=8C=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EB=B9=84=ED=99=9C=EC=84=B1=ED=99=94=20=EB=B6=84?= =?UTF-8?q?=EA=B8=B0=20=EB=A1=9C=EC=A7=81=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/mypage/MypageScript.js | 22 ++++++++++------------ src/views/login/mypage/MypageView.vue | 7 ++++++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/views/login/mypage/MypageScript.js b/src/views/login/mypage/MypageScript.js index 173cdc6..4e6a3fb 100644 --- a/src/views/login/mypage/MypageScript.js +++ b/src/views/login/mypage/MypageScript.js @@ -106,41 +106,41 @@ export async function verifyCurrentPassword() { // 비밀번호 변경 export async function updatePassword() { - // 현재 비밀번호 확인 여부 if (!passwordVerified.value) { alert('현재 비밀번호를 먼저 확인해주세요.') return } - // 새 비밀번호와 확인 비밀번호 일치 여부 확인 if (password.value !== confirmPassword.value) { alert('새 비밀번호가 일치하지 않습니다.') return } + if (!password.value || !confirmPassword.value) { + alert('새 비밀번호를 입력해주세요.') + return + } + try { - // API 요청 const response = await fetch( `${process.env.VUE_APP_BE_API_URL}/api/users/password`, { method: 'PATCH', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ - currentPassword: currentPassword.value, // 현재 비밀번호 - newPassword: password.value // 새 비밀번호 + currentPassword: currentPassword.value, + newPassword: password.value }), - credentials: 'include' // 세션 포함 + credentials: 'include' } ) - // 응답 처리 if (response.ok) { - const message = await response.json() // 성공 메시지 - alert(message) // "비밀번호가 성공적으로 변경되었습니다." + alert('비밀번호가 성공적으로 변경되었습니다.') password.value = '' confirmPassword.value = '' currentPassword.value = '' - passwordVerified.value = false // 비밀번호 확인 상태 초기화 + passwordVerified.value = false } else if (response.status === 400) { alert('현재 비밀번호가 일치하지 않습니다.') } else { @@ -148,8 +148,6 @@ export async function updatePassword() { } } catch (error) { console.error('비밀번호 수정 오류:', error) - } finally { - alert('비밀번호가 변경되었습니다.') } } diff --git a/src/views/login/mypage/MypageView.vue b/src/views/login/mypage/MypageView.vue index c278562..99ba79f 100644 --- a/src/views/login/mypage/MypageView.vue +++ b/src/views/login/mypage/MypageView.vue @@ -103,7 +103,12 @@ placeholder="새 비밀번호를 다시 입력하세요" class="form-input" /> -