From d243600f418b3aa2f2cd36b6e816a90ba89152c6 Mon Sep 17 00:00:00 2001 From: ByungCheol Date: Sun, 28 Jun 2026 16:59:25 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B3=84=EC=A0=95=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=EC=97=90=20=ED=9A=8C=EC=9B=90=20=ED=83=88=ED=87=B4=20=E2=80=94?= =?UTF-8?q?=202=EB=8B=A8=EA=B3=84=20=ED=99=95=EC=9D=B8=20=ED=9B=84=20?= =?UTF-8?q?=EA=B3=84=EC=A0=95=C2=B7=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - authApi.withdraw(), 강한 경고 + 2차 확인 → DELETE /auth/me → 세션 정리·홈 이동 Co-Authored-By: Claude Opus 4.8 --- src/api/authApi.js | 4 +++ src/views/settings/AccountInfoView.vue | 50 ++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/src/api/authApi.js b/src/api/authApi.js index 84e2e85..1b14da0 100644 --- a/src/api/authApi.js +++ b/src/api/authApi.js @@ -51,4 +51,8 @@ export const authApi = { profile() { return http.get('/auth/profile') }, + // 회원 탈퇴 — 계정·데이터 전체 삭제 + withdraw() { + return http.delete('/auth/me') + }, } diff --git a/src/views/settings/AccountInfoView.vue b/src/views/settings/AccountInfoView.vue index 41a8b72..b2638b8 100644 --- a/src/views/settings/AccountInfoView.vue +++ b/src/views/settings/AccountInfoView.vue @@ -186,6 +186,29 @@ async function removePhoto() { function goEdit() { router.push('/settings/account/edit') } + +// ===== 회원 탈퇴 ===== +const withdrawing = ref(false) +async function withdraw() { + if (withdrawing.value) return + const ok = await dialog.confirm( + '정말 탈퇴하시겠어요?\n\n· 계정과 모든 데이터(가계부·계좌·게시글·댓글·포인트·결제내역)가 영구 삭제됩니다.\n· 삭제된 데이터는 복구할 수 없습니다.', + { title: '회원 탈퇴', danger: true }, + ) + if (!ok) return + const ok2 = await dialog.confirm('마지막 확인입니다. 정말 탈퇴를 진행할까요?', { title: '회원 탈퇴', danger: true }) + if (!ok2) return + withdrawing.value = true + try { + await authApi.withdraw() + await auth.clear() + router.replace('/') + dialog.alert('탈퇴가 완료되었습니다. 그동안 이용해 주셔서 감사합니다.') + } catch (e) { + withdrawing.value = false + alert(e.response?.data?.message || '탈퇴에 실패했습니다. 잠시 후 다시 시도해 주세요.') + } +} @@ -729,6 +758,27 @@ function goEdit() { font-weight: 600; cursor: pointer; } +.withdraw-area { + margin-top: 1.5rem; + text-align: center; +} +.withdraw-link { + border: 0; + background: transparent; + color: var(--color-text); + opacity: 0.5; + font-size: 0.85rem; + text-decoration: underline; + cursor: pointer; +} +.withdraw-link:hover { + color: #c0392b; + opacity: 1; +} +.withdraw-link:disabled { + opacity: 0.4; + cursor: default; +} .primary-btn:hover { background: hsla(160, 100%, 32%, 1); }