개인정보 변경시 이름 수정

This commit is contained in:
주수현
2025-07-15 16:12:08 +09:00
parent dfb20241a6
commit bac40ff0b0
3 changed files with 10 additions and 2 deletions

View File

@@ -2,9 +2,11 @@ package app.module.front.config.application.security;
import java.util.Collection; import java.util.Collection;
import lombok.Getter; import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.User;
@Setter
@Getter @Getter
public class FrontHouseholdUser extends User { public class FrontHouseholdUser extends User {

View File

@@ -3,6 +3,7 @@ package app.module.front.usecase.info.userUI.updateUserUI.adapters.web;
import app.module.core.config.application.util.CommonUtil; import app.module.core.config.application.util.CommonUtil;
import app.module.core.config.application.util.CoreUtil; import app.module.core.config.application.util.CoreUtil;
import app.module.front.config.application.response.ApiResponse; import app.module.front.config.application.response.ApiResponse;
import app.module.front.config.application.security.FrontHouseholdUser;
import app.module.front.usecase.info.userFront.getUserFront.ports.GetUserFrontPortIn; import app.module.front.usecase.info.userFront.getUserFront.ports.GetUserFrontPortIn;
import app.module.front.usecase.info.userFront.getUserFront.ports.application.domain.GetUserFront; import app.module.front.usecase.info.userFront.getUserFront.ports.application.domain.GetUserFront;
import app.module.front.usecase.info.userFront.getUserFront.ports.application.domain.GetUserFrontCmd; import app.module.front.usecase.info.userFront.getUserFront.ports.application.domain.GetUserFrontCmd;
@@ -14,6 +15,9 @@ import app.module.front.usecase.info.userUI.updateUserUI.adapters.web.model.Upda
import jakarta.validation.Valid; import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@@ -45,6 +49,10 @@ class UpdateUserController {
getHousehold.getOwnerName(), getHousehold.getOwnerName(),
"PERSONAL" "PERSONAL"
)); ));
Authentication currentAuth = SecurityContextHolder.getContext().getAuthentication();
FrontHouseholdUser householdUser = (FrontHouseholdUser) currentAuth.getPrincipal();
householdUser.setOwnerName(reqVO.getOwnerName());
} }
updateUserPortIn.operate(new UpdateUserFrontCmd( updateUserPortIn.operate(new UpdateUserFrontCmd(
getHousehold.getSeq(), getHousehold.getSeq(),

View File

@@ -420,13 +420,11 @@
f.tel1.value = ENV.select.selectTel.getValue(); f.tel1.value = ENV.select.selectTel.getValue();
f.phone1.value = ENV.select.selectPhone.getValue(); f.phone1.value = ENV.select.selectPhone.getValue();
const obj = $(f).serializeObject();
ajaxUtil._ajaxAsync( ajaxUtil._ajaxAsync(
ENV.httpUrl.user, ENV.httpUrl.user,
$(f).serializeObject(), $(f).serializeObject(),
function (rstData, status) { function (rstData, status) {
if (rstData.code === 'SUCCESS') { if (rstData.code === 'SUCCESS') {
// 유효성 검사를 모두 통과한 후
ajaxUtil._alert('개인정보 변경이 완료되었습니다.', null, () => { ajaxUtil._alert('개인정보 변경이 완료되었습니다.', null, () => {
location.href = '/info'; location.href = '/info';
}); });