|
@@ -7,11 +7,13 @@ import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
import com.style24.core.support.message.TscMessageByLocale;
|
|
import com.style24.core.support.message.TscMessageByLocale;
|
|
|
|
|
+import com.style24.persistence.domain.User;
|
|
|
import com.style24.scm.biz.service.TssLoginService;
|
|
import com.style24.scm.biz.service.TssLoginService;
|
|
|
import com.style24.scm.support.controller.TssBaseController;
|
|
import com.style24.scm.support.controller.TssBaseController;
|
|
|
import com.style24.scm.support.security.session.TssSession;
|
|
import com.style24.scm.support.security.session.TssSession;
|
|
@@ -19,6 +21,7 @@ import com.style24.scm.support.security.session.TssSession;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
import com.gagaframework.web.rest.server.GagaResponse;
|
|
import com.gagaframework.web.rest.server.GagaResponse;
|
|
|
|
|
+import com.gagaframework.web.security.GagaPasswordEncoder;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Index Controller
|
|
* Index Controller
|
|
@@ -36,6 +39,9 @@ public class TssIndexController extends TssBaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TssLoginService loginService;
|
|
private TssLoginService loginService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private GagaPasswordEncoder passwordEncoder;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 첫 페이지
|
|
* 첫 페이지
|
|
|
* 로그인 하고
|
|
* 로그인 하고
|
|
@@ -111,4 +117,40 @@ public class TssIndexController extends TssBaseController {
|
|
|
return super.ok(message.getMessage("SUCC_0005"));
|
|
return super.ok(message.getMessage("SUCC_0005"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 비밀번호 변경 팝업
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @author gagamel
|
|
|
|
|
+ * @since 2020. 12. 28
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/password/change/form")
|
|
|
|
|
+ public ModelAndView passwordChangeForm() {
|
|
|
|
|
+ ModelAndView mav = new ModelAndView();
|
|
|
|
|
+
|
|
|
|
|
+ mav.setViewName("PasswordChangeForm");
|
|
|
|
|
+
|
|
|
|
|
+ return mav;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 비밀번호 변경 처리
|
|
|
|
|
+ * @param user - 사용자 정보
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @author gagamel
|
|
|
|
|
+ * @since 2020. 12. 28
|
|
|
|
|
+ */
|
|
|
|
|
+ @PostMapping("/password/change")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public GagaResponse changePassword(@RequestBody User user) {
|
|
|
|
|
+ user.setUserNo(TssSession.getInfo().getUserNo());
|
|
|
|
|
+ user.setPasswd(passwordEncoder.encode(user.getPasswd()));
|
|
|
|
|
+ user.setUpdNo(TssSession.getInfo().getUserNo());
|
|
|
|
|
+ log.info("user: {}", user);
|
|
|
|
|
+
|
|
|
|
|
+ // 비밀번호 수정
|
|
|
|
|
+ loginService.updatePassword(user);
|
|
|
|
|
+
|
|
|
|
|
+ return super.ok(message.getMessage("SUCC_0009"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|