내정보, 비밀번호 확인, 내정보 수정 : UX에 따라 수정 필요.
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
package app.module.front.usecase.household.updateFrontHousehold.adapters.web;
|
||||
|
||||
import app.module.core.usecase.household.updateFrontHousehold.ports.UpdateFrontHouseholdPortIn;
|
||||
import app.module.core.usecase.household.updateFrontHousehold.ports.application.domain.UpdateFrontHouseholdCmd;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PatchMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import app.module.front.usecase.household.updateFrontHousehold.adapters.web.model.UpdateFrontHouseholdReqVO;
|
||||
import app.module.front.usecase.household.updateFrontHousehold.adapters.web.model.UpdateFrontHouseholdResVO;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
class UpdateFrontHouseholdController {
|
||||
private final UpdateFrontHouseholdPortIn updateFrontHouseholdPortIn;
|
||||
|
||||
@PatchMapping(path = "/api/front/household/update")
|
||||
ResponseEntity<?> operate(
|
||||
@Valid UpdateFrontHouseholdReqVO reqVO, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult);
|
||||
}
|
||||
|
||||
updateFrontHouseholdPortIn.operate(new UpdateFrontHouseholdCmd(
|
||||
reqVO.getSeq(),
|
||||
reqVO.getHouseholdNum(),
|
||||
reqVO.getOwnerName(),
|
||||
reqVO.getOwnerAge(),
|
||||
reqVO.getTel(),
|
||||
reqVO.getPhone(),
|
||||
reqVO.getAddress()
|
||||
));
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(reqVO);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package app.module.front.usecase.household.updateFrontHousehold.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class UpdateFrontHouseholdReqVO {
|
||||
private Long seq;
|
||||
private String householdNum;
|
||||
private String ownerName;
|
||||
private Integer ownerAge;
|
||||
private String tel;
|
||||
private String phone;
|
||||
private String address;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package app.module.front.usecase.household.updateFrontHousehold.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class UpdateFrontHouseholdResVO {
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package app.module.front.usecase.info.user.updateUserUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.UiCodeType;
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
||||
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHousehold;
|
||||
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd;
|
||||
import app.module.core.usecase.household.updateFrontHousehold.ports.UpdateFrontHouseholdPortIn;
|
||||
import app.module.core.usecase.household.updateFrontHousehold.ports.application.domain.UpdateFrontHouseholdCmd;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import app.module.core.usecase.user.updateFrontUser.ports.application.domain.UpdateFrontUserInCmd;
|
||||
import app.module.front.config.application.response.ApiResponse;
|
||||
import app.module.front.usecase.info.user.getUserPasswordUI.adapters.web.model.GetUserPasswordReqVO;
|
||||
import app.module.front.usecase.info.user.updateUserUI.adapters.web.model.UpdateUserReqVO;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class UpdateUserController {
|
||||
|
||||
|
||||
private final UpdateFrontHouseholdPortIn updateFrontHouseholdPortIn;
|
||||
|
||||
private final GetHouseholdPortIn getHouseholdPortIn;
|
||||
|
||||
|
||||
private final CoreUtil coreUtil;
|
||||
|
||||
@PostMapping(path = "/api/front/info/user/update")
|
||||
ResponseEntity<?> operate(@RequestBody @Valid UpdateUserReqVO reqVO, BindingResult bindingResult){
|
||||
if (bindingResult.hasErrors()) {
|
||||
return coreUtil.getErrorInfo(bindingResult);
|
||||
}
|
||||
GetHousehold getHousehold = getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow();
|
||||
|
||||
updateFrontHouseholdPortIn.operate(new UpdateFrontHouseholdCmd(
|
||||
getHousehold.getSeq(),
|
||||
reqVO.getOwnerName(),
|
||||
reqVO.getOwnerAge(),
|
||||
reqVO.getTel1() + '-'+ reqVO.getTel2() + '-' + reqVO.getTel3(),
|
||||
reqVO.getPhone1() + '-'+ reqVO.getPhone2() + '-' + reqVO.getPhone3(),
|
||||
reqVO.getRegionMainCode(),
|
||||
reqVO.getRegionSubCode(),
|
||||
reqVO.getAddress()
|
||||
));
|
||||
|
||||
return ResponseEntity.ok(ApiResponse.success(null));
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,25 @@
|
||||
package app.module.front.usecase.info.user.getUserUI.adapters.web;
|
||||
package app.module.front.usecase.info.user.updateUserUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.UiCodeType;
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
||||
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class GetUserUIController {
|
||||
class UpdateUserUIController {
|
||||
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
|
||||
private final GetHouseholdPortIn getHouseholdPortIn;
|
||||
|
||||
|
||||
@GetMapping(path = "/info/user")
|
||||
String operate(Model model, HttpServletRequest request) {
|
||||
|
||||
@@ -25,6 +28,9 @@ class GetUserUIController {
|
||||
return "redirect:/"; // 요청 처리 중단
|
||||
}
|
||||
|
||||
|
||||
model.addAttribute("regionMainList",uiCodeListPortIn.connect(UiCodeType.REGION_MAIN.getCode()));
|
||||
model.addAttribute("regionSubList",uiCodeListPortIn.connect(UiCodeType.REGION_SUB.getCode()));
|
||||
model.addAttribute("userInfo",
|
||||
getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow());
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package app.module.front.usecase.info.user.updateUserUI.adapters.web.model;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor // 기본 생성자 자동 추가
|
||||
@AllArgsConstructor
|
||||
public class UpdateUserReqVO {
|
||||
|
||||
@NotBlank(message = "이름은 필수 항목입니다.")
|
||||
@Pattern(regexp = "^[가-힣]{2,10}$", message = "이름은 2~10자의 한글이어야 합니다.")
|
||||
private String ownerName;
|
||||
|
||||
@NotNull(message = "나이는 필수 항목입니다.")
|
||||
@Min(value = 0, message = "나이는 0세 이상이어야 합니다.")
|
||||
@Max(value = 120, message = "나이는 120세 이하이어야 합니다.")
|
||||
private Integer ownerAge;
|
||||
|
||||
@Pattern(regexp = "^\\d{2,3}$", message = "가구 연락처는 2~3자리 숫자여야 합니다.")
|
||||
private String tel1;
|
||||
|
||||
@Pattern(regexp = "^\\d{3,4}$", message = "가운데 번호는 3~4자리 숫자여야 합니다.")
|
||||
private String tel2;
|
||||
|
||||
@Pattern(regexp = "^\\d{4}$", message = "끝 번호는 4자리 숫자여야 합니다.")
|
||||
private String tel3;
|
||||
|
||||
@Pattern(regexp = "^\\d{2,3}$", message = "휴대폰 번호는 2~3자리 숫자여야 합니다.")
|
||||
private String phone1;
|
||||
|
||||
@Pattern(regexp = "^\\d{3,4}$", message = "가운데 번호는 3~4자리 숫자여야 합니다.")
|
||||
private String phone2;
|
||||
|
||||
@Pattern(regexp = "^\\d{4}$", message = "끝 번호는 4자리 숫자여야 합니다.")
|
||||
private String phone3;
|
||||
|
||||
@NotBlank(message = "시/도는 필수 항목입니다.")
|
||||
@Pattern(regexp = "^code\\.region\\.main\\.\\d+$", message = "시/도 형식이 올바르지 않습니다.")
|
||||
private String regionMainCode;
|
||||
|
||||
@NotBlank(message = "시/군/구는 필수 항목입니다.")
|
||||
@Pattern(regexp = "^code\\.region\\.sub\\.\\d+$", message = "시/군/구 형식이 올바르지 않습니다.")
|
||||
private String regionSubCode;
|
||||
|
||||
@NotBlank(message = "주소는 필수 항목입니다.")
|
||||
@Size(max = 255, message = "주소는 255자 이하여야 합니다.")
|
||||
private String address;
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package app.module.front.usecase.user.createUser.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.SignUpType;
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.usecase.user.createUser.ports.CreateUserPortIn;
|
||||
import app.module.core.usecase.user.createUser.ports.application.domain.CreateUser;
|
||||
import app.module.core.usecase.user.createUser.ports.application.domain.CreateUserCmd;
|
||||
import app.module.front.usecase.user.createUser.adapters.web.model.CreateUserReqVO;
|
||||
import app.module.front.usecase.user.createUser.adapters.web.validator.CreateUserValidator;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.Set;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
class CreateUserController {
|
||||
|
||||
private final CreateUserPortIn createUserPortIn;
|
||||
private final CreateUserValidator createUserValidator;
|
||||
private final CoreUtil coreUtil;
|
||||
|
||||
@PostMapping(path = "/api/public/user/create")
|
||||
ResponseEntity<?> operate(@Valid CreateUserReqVO reqVO, BindingResult bindingResult) {
|
||||
|
||||
createUserValidator.validate(reqVO, bindingResult);
|
||||
if (bindingResult.hasErrors()) {
|
||||
return coreUtil.getErrorInfo(bindingResult);
|
||||
}
|
||||
|
||||
CreateUser user =
|
||||
createUserPortIn
|
||||
.operate(
|
||||
new CreateUserCmd(
|
||||
reqVO.getId(),
|
||||
reqVO.getPassword(),
|
||||
reqVO.getEmail(),
|
||||
reqVO.getNickname(),
|
||||
SignUpType.NORMAL,
|
||||
false,
|
||||
0,
|
||||
false,
|
||||
Set.of("ROLE_GENERAL")))
|
||||
.orElseThrow();
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(user);
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package app.module.front.usecase.user.createUser.adapters.web.model;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateUserReqVO {
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
private String id;
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
private String password;
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
private String passwordRe;
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
private String email;
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
@Pattern(regexp = "^[가-힣a-zA-Z0-9_-]{2,10}$", message = "{valid.common.nickname.wrong}")
|
||||
private String nickname;
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package app.module.front.usecase.user.createUser.adapters.web.validator;
|
||||
|
||||
import app.module.front.usecase.user.createUser.adapters.web.model.CreateUserReqVO;
|
||||
import java.util.Optional;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.Errors;
|
||||
import org.springframework.validation.Validator;
|
||||
|
||||
@Component
|
||||
public class CreateUserValidator implements Validator {
|
||||
|
||||
private final String ID_REGEX = "^[a-zA-Z0-9_-]{6,12}$";
|
||||
private final String PASSWORD_REGEX = "^((?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%_\\-])\\S{6,15})$";
|
||||
private final String EMAIL_REGEX = "^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$";
|
||||
|
||||
@Override
|
||||
public boolean supports(Class<?> clazz) {
|
||||
return CreateUserReqVO.class.equals(clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(Object target, Errors errors) {
|
||||
CreateUserReqVO vo = (CreateUserReqVO) target;
|
||||
|
||||
// 아이디
|
||||
Optional.ofNullable(vo.getId())
|
||||
.filter(id -> !id.isEmpty() && !id.matches(ID_REGEX))
|
||||
.ifPresent(id -> errors.rejectValue("id", "valid.common.id.wrong"));
|
||||
|
||||
// 비밀번호
|
||||
Optional.ofNullable(vo.getPassword())
|
||||
.filter(password -> !password.isEmpty() && !password.matches(PASSWORD_REGEX))
|
||||
.ifPresent(password -> errors.rejectValue("password", "valid.common.password.wrong"));
|
||||
|
||||
// 비밀번호 재확인
|
||||
Optional.ofNullable(vo.getPasswordRe())
|
||||
.filter(passwordRe -> !passwordRe.isEmpty() && !passwordRe.equals(vo.getPassword()))
|
||||
.ifPresent(
|
||||
passwordRe -> errors.rejectValue("passwordRe", "valid.common.re.password.wrong"));
|
||||
|
||||
// 이메일
|
||||
Optional.ofNullable(vo.getEmail())
|
||||
.filter(email -> !email.isEmpty() && !email.matches(EMAIL_REGEX))
|
||||
.ifPresent(email -> errors.rejectValue("email", "valid.common.email.wrong"));
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package app.module.front.usecase.user.createUserUI.adapters.web;
|
||||
|
||||
import app.module.front.usecase.user.createUserUI.adapters.web.model.CreateUserUIReqVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class CreateUserUIController {
|
||||
|
||||
@GetMapping(path = "/user/register")
|
||||
String operate(Model model, @ModelAttribute("reqVO") CreateUserUIReqVO reqVO) {
|
||||
|
||||
return "user/register";
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package app.module.front.usecase.user.createUserUI.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateUserUIReqVO {
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package app.module.front.usecase.user.updateUser.adapters.web;
|
||||
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.usecase.user.updateFrontUser.ports.UpdateFrontUserPortIn;
|
||||
import app.module.core.usecase.user.updateFrontUser.ports.application.domain.UpdateFrontUserInCmd;
|
||||
import app.module.front.usecase.user.updateUser.adapters.web.model.UpdateUserReqVO;
|
||||
import app.module.front.usecase.user.updateUser.adapters.web.validator.UpdateUserValidator;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.PatchMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
class UpdateUserController {
|
||||
|
||||
private final UpdateFrontUserPortIn updateFrontUserPortIn;
|
||||
private final UpdateUserValidator updateUserValidator;
|
||||
private final CoreUtil coreUtil;
|
||||
|
||||
@PatchMapping(path = "/api/front/user/update")
|
||||
ResponseEntity<?> operate(@Valid UpdateUserReqVO reqVO, BindingResult bindingResult) {
|
||||
|
||||
updateUserValidator.validate(reqVO, bindingResult);
|
||||
if (bindingResult.hasErrors()) {
|
||||
return coreUtil.getErrorInfo(bindingResult);
|
||||
}
|
||||
|
||||
updateFrontUserPortIn.operate(
|
||||
new UpdateFrontUserInCmd(
|
||||
reqVO.getPassword(), reqVO.getEmail(), reqVO.getNickname(),
|
||||
reqVO.getFileMappingId()));
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(reqVO);
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package app.module.front.usecase.user.updateUser.adapters.web.model;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class UpdateUserReqVO {
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
private String id;
|
||||
|
||||
private String password;
|
||||
private String passwordRe;
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
private String email;
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
@Pattern(regexp = "^[가-힣a-zA-Z0-9_-]{1,15}$", message = "{valid.common.nickname.wrong}")
|
||||
private String nickname;
|
||||
|
||||
private List<String> fileMappingId;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package app.module.front.usecase.user.updateUser.adapters.web.validator;
|
||||
|
||||
import app.module.front.usecase.user.updateUser.adapters.web.model.UpdateUserReqVO;
|
||||
import java.util.Optional;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.Errors;
|
||||
import org.springframework.validation.Validator;
|
||||
|
||||
@Component
|
||||
public class UpdateUserValidator implements Validator {
|
||||
|
||||
private final String PASSWORD_REGEX = "^((?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%_\\-])\\S{6,15})$";
|
||||
private final String EMAIL_REGEX = "^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$";
|
||||
|
||||
@Override
|
||||
public boolean supports(Class<?> clazz) {
|
||||
return UpdateUserReqVO.class.equals(clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(Object target, Errors errors) {
|
||||
UpdateUserReqVO vo = (UpdateUserReqVO) target;
|
||||
|
||||
// 비밀번호
|
||||
Optional.ofNullable(vo.getPassword())
|
||||
.filter(password -> !password.isEmpty() && !password.matches(PASSWORD_REGEX))
|
||||
.ifPresent(password -> errors.rejectValue("password", "valid.common.password.wrong"));
|
||||
|
||||
// 비밀번호 재확인
|
||||
Optional.ofNullable(vo.getPasswordRe())
|
||||
.filter(passwordRe -> !passwordRe.isEmpty() && !passwordRe.equals(vo.getPassword()))
|
||||
.ifPresent(
|
||||
passwordRe -> errors.rejectValue("passwordRe", "valid.common.re.password.wrong"));
|
||||
|
||||
// 이메일
|
||||
Optional.ofNullable(vo.getEmail())
|
||||
.filter(email -> !email.isEmpty() && !email.matches(EMAIL_REGEX))
|
||||
.ifPresent(email -> errors.rejectValue("email", "valid.common.email.wrong"));
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package app.module.front.usecase.user.updateUserUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
||||
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd;
|
||||
import app.module.core.usecase.user.findUser.ports.FindUserPortIn;
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindUserCmd;
|
||||
import app.module.front.usecase.user.updateUserUI.adapters.web.model.UpdateUserUIReqVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class UpdateUserUIController {
|
||||
|
||||
private final GetHouseholdPortIn getHouseholdPortIn;
|
||||
|
||||
@GetMapping(path = "/user/info")
|
||||
String operate(Model model, @ModelAttribute("reqVO") UpdateUserUIReqVO reqVO) {
|
||||
|
||||
model.addAttribute("userInfo",
|
||||
getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow());
|
||||
|
||||
return "user/info";
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package app.module.front.usecase.user.updateUserUI.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class UpdateUserUIReqVO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg width="32" height="33" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M20.8047 26.0977L11.2047 16.4977L20.8047 6.89766" stroke="#212529" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 245 B |
@@ -39,7 +39,9 @@ var ajaxUtil = {
|
||||
message: alertMessage,
|
||||
type: "alert",
|
||||
callback: function() {
|
||||
console.log("alert callback");
|
||||
if (typeof afterEvent === 'function') {
|
||||
afterEvent();
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
@@ -47,7 +49,9 @@ var ajaxUtil = {
|
||||
message: alertMessage,
|
||||
type: "alert",
|
||||
callback: function() {
|
||||
console.log("alert callback");
|
||||
if (typeof afterEvent === 'function') {
|
||||
afterEvent();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -161,16 +165,23 @@ var ajaxUtil = {
|
||||
},
|
||||
422:function(rstData, status) {
|
||||
console.log(rstData)
|
||||
/**
|
||||
* TODO
|
||||
* 폼이 너무 여러가지 형식이 있는데 서버에러를 가지고 처리하는게 맞는지 검토 필요
|
||||
* 코드 정리는 나중에 하려고 그냥 만듬.... 정리 필요.
|
||||
*/
|
||||
|
||||
|
||||
let isResetDone = false;
|
||||
|
||||
$(rstData.responseJSON.fieldErrors).each((idx, oj) => {
|
||||
const target = $('[name="' + oj.field + '"]');
|
||||
|
||||
let infoBox = null;
|
||||
if (!isResetDone) {
|
||||
const formElement = target.closest('form');
|
||||
if (formElement.length > 0) {
|
||||
$(formElement).find('.component-input').removeClass('input-invalid');
|
||||
$(formElement).find('.input-flex-group').removeClass('invalid');
|
||||
$(formElement).find('.select-group').removeClass('input-invalid');
|
||||
$(formElement).find('.input-info').each(function () {
|
||||
$(this).remove();
|
||||
@@ -180,28 +191,44 @@ var ajaxUtil = {
|
||||
}
|
||||
|
||||
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>');
|
||||
}
|
||||
}
|
||||
component.addClass('input-invalid');
|
||||
//연결된 구조 일 경우 상위에 변경
|
||||
if(target.closest('.input-flex-group').length > 0){
|
||||
infoBox = target.closest('.input-flex-group').find('.input-info');
|
||||
} else {
|
||||
infoBox = component.find('.input-info');
|
||||
}
|
||||
|
||||
if (target.data('type') == 'select') {
|
||||
const component = target.parent().parent().closest('.select-group');
|
||||
if(component){
|
||||
component.addClass('select-invalid');
|
||||
let infoBox = component.find('.input-info');
|
||||
if (infoBox.length === 0) {
|
||||
infoBox = $('<ul class="input-info"></ul>').appendTo(component);
|
||||
if(target.closest('.input-flex-group').length > 0){
|
||||
infoBox = $('<ul class="input-info"></ul>').appendTo(target.closest('.input-flex-group'));
|
||||
target.closest('.input-flex-group').addClass('invalid');
|
||||
} else {
|
||||
infoBox = $('<ul class="input-info"></ul>').appendTo(component);
|
||||
}
|
||||
}
|
||||
infoBox.html('<li>' + oj.message + '</li>');
|
||||
}
|
||||
}
|
||||
|
||||
if (target.data('type') === 'select') {
|
||||
|
||||
const component = target.parent().parent().closest('.select-group');
|
||||
if (component) {
|
||||
component.addClass('select-invalid');
|
||||
|
||||
infoBox = component.find('.input-info');
|
||||
if (infoBox.length === 0) {
|
||||
infoBox = $('<ul class="input-info"></ul>').appendTo(component);
|
||||
}
|
||||
|
||||
infoBox.html('<li>' + oj.message + '1111</li>');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
if ($('.input-info').length === 0) {
|
||||
|
||||
@@ -61,12 +61,12 @@
|
||||
obj,
|
||||
function (rstData, status) {
|
||||
if(rstData.code ==='SUCCESS'){
|
||||
location.href = ENV.httpUrl.user;
|
||||
location.replace(ENV.httpUrl.user);
|
||||
} else if (rstData.code === 'ERROR'){
|
||||
if(rstData.message ==='INVALID_PASSWORD'){
|
||||
ajaxUtil._alert('비밀번호가 일치하지 않습니다.', '비밀번호 확인');
|
||||
ajaxUtil._alert('입력하신 정보가 맞지 않습니다.\n 다시 확인해주세요.',null);
|
||||
} else {
|
||||
ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', '비밀번호 확인');
|
||||
ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', null);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<p class="form-desc">필수입력</p>
|
||||
|
||||
<section class="form-group">
|
||||
<form method="post" name="reqForm" id="reqForm" onsubmit="formControl.authInfoUser();" th:action="@{/api/front/info/user/update}" th:object="${userInfo}">
|
||||
<!-- 이름 -->
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
@@ -18,7 +19,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="text" id="temp_input_0001" placeholder="이름을 입력해 주세요">
|
||||
<input type="text" id="temp_input_0001" placeholder="이름을 입력해 주세요" th:field="*{ownerName}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 연령 -->
|
||||
@@ -29,19 +30,21 @@
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="number" id="temp_input_0002" placeholder="만 나이를 입력해 주세요">
|
||||
<input type="number" id="temp_input_0002" placeholder="만 나이를 입력해 주세요" th:field="*{ownerAge}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 가구연락처 -->
|
||||
<div class="input-flex-group type-num">
|
||||
<div class="input-label">
|
||||
<label for="temp_input_00012" class="label-txt">
|
||||
<label for="tel1Id" class="label-txt">
|
||||
가구 연락처
|
||||
</label>
|
||||
</div>
|
||||
<div class="d-flex">
|
||||
<div class="select-group">
|
||||
<div id="temp_input_00012" class="component-select bottom-sheet" data-props-default="선택" data-props-type="bottomSheet">
|
||||
|
||||
<div id="tel1Id" class="component-select bottom-sheet" th:data-props-default="${userInfo.tel1}" data-props-type="bottomSheet">
|
||||
<input type="hidden" th:field="*{tel1}" data-type="select">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt"></span>
|
||||
</button>
|
||||
@@ -54,12 +57,23 @@
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option" data-value="option1">option1</li>
|
||||
<li class="option" data-value="option2">option2</li>
|
||||
<li class="option" data-value="option3">option3</li>
|
||||
<li class="option" data-value="option4">option4</li>
|
||||
<li class="option" data-value="option5">option5</li>
|
||||
<li class="option" data-value="option6">option6</li>
|
||||
<li class="option" data-value="02">02</li>
|
||||
<li class="option" data-value="31">31</li>
|
||||
<li class="option" data-value="033">033</li>
|
||||
<li class="option" data-value="042">042</li>
|
||||
<li class="option" data-value="043">043</li>
|
||||
<li class="option" data-value="051">051</li>
|
||||
<li class="option" data-value="052">052</li>
|
||||
<li class="option" data-value="053">053</li>
|
||||
<li class="option" data-value="054">054</li>
|
||||
<li class="option" data-value="055">055</li>
|
||||
<li class="option" data-value="061">061</li>
|
||||
<li class="option" data-value="062">062</li>
|
||||
<li class="option" data-value="063">063</li>
|
||||
<li class="option" data-value="064">064</li>
|
||||
<li class="option" data-value="010">010</li>
|
||||
<li class="option" data-value="011">011</li>
|
||||
<li class="option" data-value="111">111</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,12 +81,12 @@
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="number" id="temp_input_0003" placeholder=0000>
|
||||
<input type="number" placeholder=0000 th:field="*{tel2}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="number" id="temp_input_0004" placeholder=0000>
|
||||
<input type="number" placeholder=0000 th:field="*{tel3}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,13 +94,16 @@
|
||||
<!-- 휴대폰 번호 -->
|
||||
<div class="input-flex-group type-num">
|
||||
<div class="input-label">
|
||||
<label for="temp_input_0005" class="label-txt">
|
||||
<label for="phoneId" class="label-txt">
|
||||
휴대폰 번호 <i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="d-flex">
|
||||
<div class="select-group">
|
||||
<div id="temp_input_0005" class="component-select bottom-sheet" data-props-default="선택" data-props-type="bottomSheet">
|
||||
|
||||
|
||||
<div id="phoneId" class="component-select bottom-sheet" th:data-props-default="${userInfo.phone1}" data-props-type="bottomSheet">
|
||||
<input type="hidden" th:field="*{phone1}" data-type="select">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt"></span>
|
||||
</button>
|
||||
@@ -99,12 +116,8 @@
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option" data-value="option1">option1</li>
|
||||
<li class="option" data-value="option2">option2</li>
|
||||
<li class="option" data-value="option3">option3</li>
|
||||
<li class="option" data-value="option4">option4</li>
|
||||
<li class="option" data-value="option5">option5</li>
|
||||
<li class="option" data-value="option6">option6</li>
|
||||
<li class="option" data-value="010">010</li>
|
||||
<li class="option" data-value="011">011</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -112,12 +125,12 @@
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="number" id="temp_input_0006" placeholder=0000>
|
||||
<input type="number" id="temp_input_0006" placeholder=0000 th:field="*{phone2}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="number" id="temp_input_0007" placeholder=0000>
|
||||
<input type="number" id="temp_input_0007" placeholder=0000 th:field="*{phone3}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -131,7 +144,10 @@
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</p>
|
||||
</div>
|
||||
<div id="select213" class="component-select bottom-sheet" data-props-default="시/도 선택" data-props-type="bottomSheet">
|
||||
|
||||
|
||||
<div id="regionMainCodeId" class="component-select bottom-sheet" data-props-default="시/도 선택" data-props-type="bottomSheet">
|
||||
<input type="hidden" th:field="*{regionMainCode}" data-type="select">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt">선택</span>
|
||||
</button>
|
||||
@@ -144,20 +160,20 @@
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option" data-value="option1">option1</li>
|
||||
<li class="option" data-value="option2">option2</li>
|
||||
<li class="option" data-value="option3">option3</li>
|
||||
<li class="option" data-value="option4">option4</li>
|
||||
<li class="option" data-value="option5">option5</li>
|
||||
<li class="option" data-value="option6">option6</li>
|
||||
<li class="option" data-value="option7">option7</li>
|
||||
<th:block th:each="item : ${regionMainList}">
|
||||
<li class="option" th:data-value="${item.codeValue}" th:text="${item.codeText}">option1</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="select-group">
|
||||
<div id="select3" class="component-select bottom-sheet" data-props-default="시/군/구 선택" data-props-type="bottomSheet">
|
||||
<div id="regionSubCodeId" class="component-select bottom-sheet" data-props-default="시/군/구 선택" data-props-type="bottomSheet">
|
||||
<input type="hidden" th:field="*{regionSubCode}" data-type="select">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt">선택</span>
|
||||
</button>
|
||||
@@ -170,13 +186,10 @@
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option" data-value="option1">option1</li>
|
||||
<li class="option" data-value="option2">option2</li>
|
||||
<li class="option" data-value="option3">option3</li>
|
||||
<li class="option" data-value="option4">option4</li>
|
||||
<li class="option" data-value="option5">option5</li>
|
||||
<li class="option" data-value="option6">option6</li>
|
||||
<li class="option" data-value="option7">option7</li>
|
||||
<th:block th:each="item : ${regionSubList}">
|
||||
<li class="option" th:data-value="${item.codeValue}" th:text="${item.codeText}" >option1</li>
|
||||
</th:block>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -184,15 +197,16 @@
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="text" id="temp_input_00023" placeholder="세부 주소를 입력해 주세요">
|
||||
<input type="text" id="temp_input_00023" placeholder="세부 주소를 입력해 주세요" th:field="*{address}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<div class="component-btns">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-full btn-l btn-primary">
|
||||
<button type="button" class="btn btn-full btn-l btn-primary" onclick="formControl.confirmPopup()">
|
||||
<span class="btn-txt">변경</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -200,42 +214,147 @@
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 모달 팝업 -->
|
||||
<div class="layer-wrap">
|
||||
<div class="component-modal confirmPopup" data-props-dimm-click="true">
|
||||
<div class="modal-dimm"></div>
|
||||
<div class="modal-frame">
|
||||
<div class="modal-container">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-tit">개인정보 수집 및 활용 동의</h3>
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-content-inner">
|
||||
<div>
|
||||
이런 저런 내용<br><br><br><br><br><br><br><br><br>모달 스크롤 적용필요!!!
|
||||
</div>
|
||||
<div class="component-btns">
|
||||
<div class="btns-row two-col">
|
||||
<div class="btns-col-1">
|
||||
<button type="button" class="btn btn-full btn-l btn-secondary" onclick="ENV.module.confirmPopup.close();">
|
||||
<span class="btn-txt">동의 안함</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btns-col-2">
|
||||
<button type="button" class="btn btn-full btn-l btn-primary" onclick="formControl.confirmPopupOk()">
|
||||
<span class="btn-txt">동의</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="modal-close"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- //모달 팝업 -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: /*[[|#{uri.front.info.user.path}/password|]]*/'rootUrl',
|
||||
auth: /*[[|/api/front#{uri.front.info.user.path}/password/auth|]]*/'passwordAuthUrl',
|
||||
user: /*[[#{uri.front.info.user.path}]]*/'userUrl',
|
||||
|
||||
root: /*[[#{uri.front.info.user.path}]]*/'rootUrl',
|
||||
user: /*[[|/api/front#{uri.front.info.user.path}/update|]]*/'updateUrl',
|
||||
myInfo: /*[[#{uri.front.info.path}]]*/'myInfoUrl',
|
||||
},
|
||||
module:{
|
||||
confirmPopup : null
|
||||
},
|
||||
submitted: false,
|
||||
};
|
||||
|
||||
let formControl = {
|
||||
authInfoUser() {
|
||||
init(){
|
||||
this._bindUI()
|
||||
},
|
||||
_bindUI(){
|
||||
ENV.module.confirmPopup = document.querySelector(".confirmPopup").ui;
|
||||
},
|
||||
confirmPopup(){
|
||||
ENV.module.confirmPopup.open();
|
||||
},
|
||||
confirmPopupOk(){
|
||||
ENV.module.confirmPopup.close();
|
||||
|
||||
setTimeout(function() {
|
||||
formControl.updateUserInfo();
|
||||
}, 500);
|
||||
},
|
||||
updateUserInfo() {
|
||||
|
||||
const f = document.reqForm;
|
||||
// TODO 어쩔수 없이 이렇게 하는데..... 콤포넌트값 핸들링 방법 UX에서 지정하면 수정해야함.
|
||||
const tel1Element = document.getElementById('tel1Id');
|
||||
const phone1IdElement = document.getElementById('phone1Id');
|
||||
const regionMainCodeIdElement = document.getElementById('regionMainCodeId');
|
||||
const regionSubCodeIdElement = document.getElementById('regionSubCodeId');
|
||||
if (tel1Element && tel1Element.value) {
|
||||
f.tel1.value = tel1Element.value;
|
||||
}
|
||||
if (phone1IdElement && phone1IdElement.value) {
|
||||
f.phone1.value = phone1IdElement.value;
|
||||
}
|
||||
if (regionMainCodeIdElement && regionMainCodeIdElement.value) {
|
||||
f.regionMainCode.value = regionMainCodeIdElement.value;
|
||||
}
|
||||
if (regionSubCodeIdElement && regionSubCodeIdElement.value) {
|
||||
f.regionSubCode.value = regionSubCodeIdElement.value;
|
||||
}
|
||||
|
||||
|
||||
const obj = $(f).serializeObject();
|
||||
console.log(obj)
|
||||
ajaxUtil._ajaxAsync(
|
||||
ENV.httpUrl.auth,
|
||||
obj,
|
||||
function (rstData, status) {
|
||||
if(rstData.code ==='SUCCESS'){
|
||||
location.href = ENV.httpUrl.user;
|
||||
} else if (rstData.code === 'ERROR'){
|
||||
if(rstData.message ==='INVALID_PASSWORD'){
|
||||
ajaxUtil._alert('비밀번호가 일치하지 않습니다.', '비밀번호 확인');
|
||||
} else {
|
||||
ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', '비밀번호 확인');
|
||||
}
|
||||
}
|
||||
},
|
||||
ENV.httpUrl.user,
|
||||
obj,
|
||||
function (rstData, status) {
|
||||
if(rstData.code ==='SUCCESS'){
|
||||
ajaxUtil._alert('개인정보 변경이 완료되었습니다.', null, function () {
|
||||
/**
|
||||
* TODO
|
||||
* 내정보에서만 들어온다는 가정하에서 back을 하게함 SB에는 내정보로 이동하게 되어 있음.
|
||||
*/
|
||||
history.back()
|
||||
});
|
||||
} else if (rstData.code === 'ERROR'){
|
||||
ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', null);
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
telAndPhoneCheck(tel1, tel2, tel3) {
|
||||
// 공백 제거
|
||||
tel1 = tel1.trim();
|
||||
tel2 = tel2.trim();
|
||||
tel3 = tel3.trim();
|
||||
|
||||
const telRegex = /^[0-9]+$/;
|
||||
if (!telRegex.test(tel1) || !telRegex.test(tel2) || !telRegex.test(tel3)) {
|
||||
return null;
|
||||
}
|
||||
if (!((tel1.length === 2 || tel1.length === 3) && tel2.length === 4 && tel3.length === 4)) {
|
||||
return null;
|
||||
}
|
||||
const formatted = `${tel1}-${tel2}-${tel3}`;
|
||||
return formatted;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
</script>
|
||||
</section>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
</h3>
|
||||
|
||||
<div class="">
|
||||
<label for="">ID</label>
|
||||
<input autofocus class="" id="floatingInput" name="username" placeholder="ID를 입력해주세요"
|
||||
<label for="floatingInput">ID</label>
|
||||
<input autofocus class="" id="floatingInput" name="username" placeholder="ID를 입력해주세요" value="11111"
|
||||
type="text">
|
||||
</div>
|
||||
<div class="">
|
||||
<label for="floatingPassword">Password</label>
|
||||
<input class="f" id="floatingPassword" name="password" placeholder="Password" type="password">
|
||||
<input class="f" id="floatingPassword" name="password" placeholder="Password" type="password" value="1111">
|
||||
</div>
|
||||
|
||||
<div class="">
|
||||
|
||||
Reference in New Issue
Block a user