|
|
@@ -24,9 +24,11 @@ import com.style24.front.support.controller.TsfBaseController;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+import org.springframework.web.bind.support.SessionStatus;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpSession;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -234,10 +236,18 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
* @author jsshin
|
|
|
* @since 2021. 02. 17
|
|
|
*/
|
|
|
- @GetMapping("password/change/form")
|
|
|
+ @GetMapping("/password/change/form")
|
|
|
public ModelAndView passwrodChangeForm(@RequestParam(value = "pageGb")String pageGb) {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
- String custNo = TscSession.getAttribute("custNo");
|
|
|
+ String custNo = "";
|
|
|
+
|
|
|
+ if ("find".equals(pageGb)) { //비밀번호 찾기 사용
|
|
|
+ custNo = TscSession.getAttribute("custNo");
|
|
|
+ }
|
|
|
+
|
|
|
+ if ("temp".equals(pageGb)) { // 비밀번호 변경 캠페인, 임시비밀번호로 로그인시 사용
|
|
|
+ custNo = String.valueOf(TsfSession.getInfo().getCustNo());
|
|
|
+ }
|
|
|
|
|
|
// 고객번호 없으면 인증화면으로 돌아감
|
|
|
if (StringUtils.isBlank(custNo)) {
|
|
|
@@ -252,7 +262,7 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
if (custInfo != null) {
|
|
|
mav.addObject("custId", custInfo.getCustId());
|
|
|
}
|
|
|
-
|
|
|
+ mav.addObject("pageGb", pageGb);
|
|
|
mav.setViewName(super.getDeviceViewName("customer/PasswordChangeForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
@@ -269,8 +279,14 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
@ResponseBody
|
|
|
public GagaMap resetPassword(@RequestBody Customer customer) {
|
|
|
GagaMap result = new GagaMap();
|
|
|
- String custNo = TscSession.getAttribute("custNo");
|
|
|
boolean isSuccess = false;
|
|
|
+ String custNo = "";
|
|
|
+ if (TsfSession.isLogin()) {
|
|
|
+ custNo = String.valueOf(TsfSession.getInfo().getCustNo());
|
|
|
+ } else {
|
|
|
+ custNo = TscSession.getAttribute("custNo");
|
|
|
+ }
|
|
|
+
|
|
|
if (StringUtils.isBlank(custNo)) {
|
|
|
throw new IllegalStateException("고객 정보가 없습니다. 다시 확인 해주세요.");
|
|
|
}
|
|
|
@@ -687,16 +703,16 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
*/
|
|
|
@PostMapping("/dormant/release")
|
|
|
@ResponseBody
|
|
|
- public GagaMap releaseDormantCustomer(@RequestBody Customer customer) {
|
|
|
+ public GagaMap releaseDormantCustomer(@RequestBody Customer customer, HttpSession session) {
|
|
|
String custNo = TsfSession.getAttribute("custNo");
|
|
|
if (StringUtils.isBlank(custNo) || StringUtils.isBlank(customer.getEncData())) {
|
|
|
- throw new IllegalStateException("로그인 후 재인증 해주세요.");
|
|
|
+ throw new IllegalStateException("로그인 다시 시도해주세요.");
|
|
|
}
|
|
|
GagaMap resultInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
|
|
|
|
|
|
customer.setCi(resultInfo.getString("sCi"));
|
|
|
customer.setCustNo(Integer.parseInt(custNo));
|
|
|
-
|
|
|
+ session.removeAttribute("custNo"); // 고객번호 세션 삭제
|
|
|
return customerService.releaseDormantCustomer(customer);
|
|
|
}
|
|
|
|
|
|
@@ -721,7 +737,7 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
*
|
|
|
* @return ModelAndView - 가입완료 화면
|
|
|
* @author jsshin
|
|
|
- * @since 2021. 03. 08
|
|
|
+ * @since 2021. 03. 10
|
|
|
*/
|
|
|
@GetMapping("/certification/form")
|
|
|
public ModelAndView getCertificationForm() {
|
|
|
@@ -732,9 +748,55 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
return mav;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 본인인증 처리
|
|
|
+ *
|
|
|
+ * @param customer - 본인인증키
|
|
|
+ * @return GagaMap - 결과
|
|
|
+ * @author jsshin
|
|
|
+ * @since 2021. 03. 11
|
|
|
+ */
|
|
|
@PostMapping("/certification/save")
|
|
|
- public GagaMap saveCertification(Customer customer) {
|
|
|
- return null;
|
|
|
+ @ResponseBody
|
|
|
+ public GagaMap saveCertification(@RequestBody Customer customer, HttpSession session) {
|
|
|
+ String custNo = TsfSession.getAttribute("custNo");
|
|
|
+ if (StringUtils.isBlank(custNo) || StringUtils.isBlank(customer.getEncData())) {
|
|
|
+ throw new IllegalStateException("로그인 다시 시도해 주세요.");
|
|
|
+ }
|
|
|
+ GagaMap resultInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
|
|
|
+ customer.setCi(resultInfo.getString("sCi"));
|
|
|
+ customer.setCustNo(Integer.parseInt(custNo));
|
|
|
+ session.removeAttribute("custNo"); // 고객번호 세션 삭제
|
|
|
+ return customerService.saveCertification(customer);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 비밀번호 변경 캠페인 화면
|
|
|
+ *
|
|
|
+ * @return ModelAndView - 가입완료 화면
|
|
|
+ * @author jsshin
|
|
|
+ * @since 2021. 03. 11
|
|
|
+ */
|
|
|
+ @GetMapping("/password/campaign/form")
|
|
|
+ public ModelAndView getPasswordCampaignnForm() {
|
|
|
+ ModelAndView mav = new ModelAndView();
|
|
|
+
|
|
|
+ mav.setViewName(super.getDeviceViewName("customer/PasswordCampaignForm"));
|
|
|
+
|
|
|
+ return mav;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/password/date/update")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaMap updatePasswordDate(@RequestBody Customer customer) {
|
|
|
+ Integer custNo = TsfSession.getInfo().getCustNo();
|
|
|
+ if (custNo == null) {
|
|
|
+ throw new IllegalStateException("로그인 다시 시도해 주세요.");
|
|
|
+ }
|
|
|
+ customer.setCustNo(custNo);
|
|
|
+ return customerService.updatePasswordDate(customer);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|