From dcc42daceaa5890c7f878dded98c22cd8482f0b6 Mon Sep 17 00:00:00 2001 From: kangsunlee Date: Mon, 30 Jun 2025 09:35:39 +0900 Subject: [PATCH] =?UTF-8?q?[FO]=20front=20=EA=B0=9C=EC=9D=B8=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=EB=B3=80=EA=B2=BD=20=EC=88=98=EC=A0=95,=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=EC=97=94=EC=A7=84=20=EC=83=89=EC=9D=B8=20=EB=B0=A9?= =?UTF-8?q?=EC=A7=80=EB=A5=BC=20=EC=9C=84=ED=95=9C=20meta=20=ED=83=9C?= =?UTF-8?q?=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/common/components.html | 1 + .../resources/templates/info/user/user.html | 31 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/front/src/main/resources/templates/common/components.html b/front/src/main/resources/templates/common/components.html index 9e5e5eb1..90c4c77e 100644 --- a/front/src/main/resources/templates/common/components.html +++ b/front/src/main/resources/templates/common/components.html @@ -25,6 +25,7 @@ + diff --git a/front/src/main/resources/templates/info/user/user.html b/front/src/main/resources/templates/info/user/user.html index 7c444527..5671e4ae 100644 --- a/front/src/main/resources/templates/info/user/user.html +++ b/front/src/main/resources/templates/info/user/user.html @@ -333,24 +333,22 @@ // selectboxInstance1.setValue($('input[name=regionMainCode]').val()); }, confirmPopup() { + // 이름 변경 여부 처리 const currentName = document.querySelector('input[name="ownerName"]').value.trim(); + const isNameChanged = currentName !== ENV.initialOwnerName; - if (currentName === '') { // 이름 비어있을 경우 유효성검사 실시 - formControl.updateUserInfo(); - } else if (currentName !== ENV.initialOwnerName) { // 이름이 변경됐을 경우 개인정보동의 모달창 띄우기 - ENV.module.confirmPopup.open(); - } else { - formControl.updateUserInfo(); - } + formControl.updateUserInfo(isNameChanged); }, confirmPopupOk() { ENV.module.confirmPopup.close(); - setTimeout(function () { - formControl.updateUserInfo(); + setTimeout(() => { + ajaxUtil._alert('개인정보 변경이 완료되었습니다.', null, () => { + location.href = '/info'; + }); }, 500); }, - updateUserInfo() { + updateUserInfo(showPopupIfValidNameChanged = false) { const f = document.reqForm; // // TODO 어쩔수 없이 이렇게 하는데..... 콤포넌트값 핸들링 방법 UX에서 지정하면 수정해야함. @@ -386,14 +384,13 @@ obj, function (rstData, status) { if (rstData.code === 'SUCCESS') { - ajaxUtil._alert('개인정보 변경이 완료되었습니다.', null, function () { - /** - * TODO - * 내정보에서만 들어온다는 가정하에서 back을 하게함 SB에는 내정보로 이동하게 되어 있음. - */ - // history.back(); + // 유효성 검사를 모두 통과한 후 + if (showPopupIfValidNameChanged) { + // 이름이 바뀐 경우만 팝업 + ENV.module.confirmPopup.open(); + } else { location.href = '/info'; - }); + } } else if (rstData.code === 'ERROR') { ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', null); }