front 로그인 작업 중 (2)
This commit is contained in:
@@ -88,7 +88,7 @@
|
||||
<a href="/login">[로그인]</a>
|
||||
</p>
|
||||
<p sec:authorize="isAuthenticated()" th:remove="tag">
|
||||
<strong th:text="${#authentication.principal.nickname}">로그인 사용자명</strong>
|
||||
<strong th:text="${#authentication.principal.ownerName}">로그인 사용자명</strong>
|
||||
<a href="/logout">[로그아웃]</a>
|
||||
<a href="/user/info">[정보수정]</a>
|
||||
</p>
|
||||
|
||||
@@ -35,48 +35,47 @@
|
||||
method="get"
|
||||
name="reqForm"
|
||||
th:action="@{/user/info}" th:object="${userInfo}">
|
||||
<input type="hidden" name="id" th:value="*{id}">
|
||||
<div>
|
||||
<label class="form-label d-block" for="profileImgFile">프로필 이미지</label>
|
||||
<div class="input-group w-50">
|
||||
<input accept="image/*" class="form-control"
|
||||
id="profileImgFile"
|
||||
name="profileImgFile"
|
||||
onchange="uiUtil.uploadFile('PROFILE_IMG', this);"
|
||||
type="file">
|
||||
<div class="invalid-feedback field-profileImgFile">
|
||||
에러 메세지
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="userId">아이디</label>
|
||||
<input id="userId" name="id" placeholder="아이디" readonly="readonly" th:field="*{id}"
|
||||
<label for="householdNum">임가번호</label>
|
||||
<input id="householdNum" name="householdNum" placeholder="아이디" readonly="readonly" th:field="*{householdNum}"
|
||||
type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="nickname">닉네임</label>
|
||||
<input id="nickname" name="nickname" placeholder="닉네임" th:field="*{nickname}" type="text">
|
||||
<label for="ownerName">경영주</label>
|
||||
<input id="ownerName" name="ownerName" placeholder="경영주 이름" th:field="*{ownerName}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="userPwd">새 비밀번호</label>
|
||||
<input id="userPwd" name="password" placeholder="변경할 패스워드를 입력해주세요." th:field="*{password}"
|
||||
type="password">
|
||||
<div class="invalid-feedback field-password"></div>
|
||||
<label for="ownerAge">만나이</label>
|
||||
<input id="ownerAge" name="ownerAge" placeholder="나이" th:field="*{ownerAge}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="userPwdRe">새 비밀번호 재확인</label>
|
||||
<input id="userPwdRe" name="passwordRe" placeholder="변경할 패스워드를 재입력해주세요."
|
||||
type="password">
|
||||
<div class="invalid-feedback field-passwordRe"></div>
|
||||
<label for="tel">가구연락처</label>
|
||||
<input id="tel" name="tel" placeholder="가구연락처" th:field="*{tel}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="userEmail">이메일</label>
|
||||
<input id="userEmail" name="email" placeholder="이메일을 입력해주세요." th:field="*{email}"
|
||||
type="text">
|
||||
<div class="invalid-feedback field-email"></div>
|
||||
<label for="phone">핸드폰번호</label>
|
||||
<input id="phone" name="phone" placeholder="핸드폰번호" th:field="*{phone}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="region">시.도</label>
|
||||
<input id="region" name="region" placeholder="시.도" th:field="*{region}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="city">시.군.도</label>
|
||||
<input id="city" name="city" placeholder="시.군.도" th:field="*{city}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="addressDetail">세부 주소</label>
|
||||
<input id="addressDetail" name="addressDetail" placeholder="세부 주소" th:field="*{addressDetail}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
</form>
|
||||
<button onclick="updateUser();">수정하기</button>
|
||||
@@ -94,7 +93,7 @@
|
||||
|
||||
$.ajax({
|
||||
method: 'PATCH',
|
||||
url: '/api/front/user/update',
|
||||
url: '/api/front/household/update',
|
||||
data: obj,
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
@@ -102,7 +101,7 @@
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success(res) {
|
||||
if (confirm(`'${res.id}' 정보가 수정되었습니다.`)) {
|
||||
if (confirm(`'${res.ownerName} 님의' 정보가 수정되었습니다.`)) {
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
@@ -121,21 +120,6 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<script th:inline="javascript">
|
||||
const showProfileImage = () => {
|
||||
const f = document.reqForm;
|
||||
const uploadFile = [[${userInfo.uploadFile}]];
|
||||
|
||||
if (uploadFile != null) {
|
||||
const input = $(f.profileImgFile);
|
||||
input.parent().append(
|
||||
`<input type="hidden" name="fileMappingId" value="${uploadFile.id}"/>`);
|
||||
uiUtil.showFileInfo(input, uploadFile, true);
|
||||
}
|
||||
}
|
||||
|
||||
showProfileImage();
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user