내정보 > 비밀번호 확인 추가 + 값체크 추가.

This commit is contained in:
DESKTOP-E9DJS27\etribe
2025-06-12 11:25:25 +09:00
parent 235248580c
commit 403fd5d2bd
6 changed files with 184 additions and 5 deletions

View File

@@ -13,10 +13,16 @@ uri.front.statistics=\uD1B5\uACC4
# \uB0B4\uC815\uBCF4
uri.front.info=\uB0B4\uC815\uBCF4
uri.front.info.path=/info
uri.front.info.user=\uAC1C\uC778\uC815\uBCF4
uri.front.info.user.path=/info/user
uri.front.info.user.password=\uBE44\uBC00\uBC88\uD638 \uD655\uC778
uri.front.info.notice=\uACF5\uC9C0\uC0AC\uD56D
uri.front.info.notice.path=/info/notice
uri.front.info.monthly=\uC6D4\uBCC4 \uC784\uC0B0\uBB3C \uD604\uD669
uri.front.info.monthly.path=/info/monthly
uri.front.info.bank=\uC740\uD589 \uC790\uB3D9\uC774\uCCB4 \uB0B4\uC5ED
uri.front.info.bank.path=/info/bank

View File

@@ -149,12 +149,34 @@ var ajaxUtil = {
},
422:function(rstData, status) {
console.log(rstData)
$(rstData.responseJSON).each((idx, oj) => {
// TODO : form id? or body
let target = $('body').find('[name=' + oj.field + ']');
target.addClass('is-invalid');
target.parent().find('.invalid-feedback').text(oj.defaultMessage);
let isResetDone = false;
$(rstData.responseJSON.fieldErrors).each((idx, oj) => {
const target = $('[name="' + oj.field + '"]');
if (!isResetDone) {
const formElement = target.closest('form');
if (formElement.length > 0) {
$(formElement).find('.component-input').removeClass('input-invalid');
$(formElement).find('.input-info').each(function () {
$(this).remove();
});
}
isResetDone = true;
}
if (target.length > 0) {
const component = target.closest('.component-input');
if(component){
component.addClass('input-invalid');
let infoBox = component.find('.input-info');
if (infoBox.length === 0) {
infoBox = $('<ul class="input-info"></ul>').appendTo(component);
}
infoBox.html('<li>' + oj.message + '</li>');
}
}
});
if ($('.invalid-feedback').length === 0) {

View File

@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns:th="http://www.thymeleaf.org">
<div layout:fragment="content" th:classappend="'mypage-wrap'">
<main id="content" role="main">
<div class="inner">
<hgroup class="tit-group">
<h3>
개인정보 보호를 위해 <br>
<strong>비밀번호를 다시 입력</strong>해 주세요.
</h3>
<p>본인 확인 후 개인정보 변경이 가능합니다.</p>
</hgroup>
<section class="form-group">
<form method="post" name="reqForm" id="reqForm" onsubmit="formControl.authInfoUser();" th:action="@{/}" >
<div class="component-input" data-props-toggle-Password="true">
<div class="input-label">
<label for="temp_input_0001" class="label-txt">
비밀번호
</label>
</div>
<div class="input-field">
<input type="password" id="temp_input_0001" placeholder="비밀번호 4자리를 입력해 주세요" name="password">
</div>
</div>
<div class="component-btns">
<div class="btns-row">
<button type="button" class="btn btn-full btn-l btn-primary" onclick="formControl.authInfoUser()">
<span class="btn-txt">다음</span>
</button>
</div>
</div>
</section>
</div>
</main>
</div>
<section layout:fragment="script">
<script th:inline="javascript">
let ENV = {
httpUrl: {
root: /*[[#{uri.front.info.user.path}]]*/'rootUrl',
auth: /*[[|/api/front#{uri.front.info.user.path}/password/auth|]]*/'passwordAuthUrl',
},
submitted: false,
};
let formControl = {
authInfoUser() {
const f = document.reqForm;
const obj = $(f).serializeObject();
ajaxUtil._ajaxAsync(
ENV.httpUrl.auth,
obj,
function (rstData, status) {
console.log(rstData.status)
},
);
}
};
</script>
</section>
</html>