|
|
@@ -1,5 +1,7 @@
|
|
|
package com.style24.scm.biz.web;
|
|
|
|
|
|
+import java.util.Collection;
|
|
|
+
|
|
|
import javax.servlet.http.HttpSession;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -24,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import com.gagaframework.web.rest.server.GagaResponse;
|
|
|
import com.gagaframework.web.security.GagaPasswordEncoder;
|
|
|
+import com.gagaframework.web.util.GagaCryptoUtil;
|
|
|
|
|
|
/**
|
|
|
* Index Controller
|
|
|
@@ -67,25 +70,33 @@ public class TssIndexController extends TssBaseController {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
|
if (TssSession.isLogin()) {
|
|
|
- if (TssSession.isTwoFactorCertify()) { // 2factor인증이 되었으면
|
|
|
- // 공지사항 팝업 총건수
|
|
|
- mav.addObject("noticeCnt", noticeService.getNoticePopupTotalCount());
|
|
|
-
|
|
|
- // 대쉬보드 페이지로
|
|
|
- mav.setViewName("dashboard");
|
|
|
- } else {
|
|
|
- // 운영서버에서만 2factor인증 진행
|
|
|
- if ("run".equals(env.getProperty("spring.profiles.active")) || "style".equals(env.getProperty("spring.profiles.active"))) {
|
|
|
- // 2factor인증번호 발송
|
|
|
- loginService.sendTwoFactorCertNo();
|
|
|
-
|
|
|
- // 2factor인증 페이지로
|
|
|
- mav.setViewName("signin2");
|
|
|
- } else {
|
|
|
- // 대쉬보드 페이지로
|
|
|
- mav.setViewName("dashboard");
|
|
|
- }
|
|
|
- }
|
|
|
+ // TODO. 2factor인증 적용 시 74~92라인 주석 해제. 94~98라인 삭제
|
|
|
+// if (TssSession.isTwoFactorCertify()) { // 2factor인증이 되었으면
|
|
|
+// // 공지사항 팝업 총건수
|
|
|
+// mav.addObject("noticeCnt", noticeService.getNoticePopupTotalCount());
|
|
|
+//
|
|
|
+// // 대쉬보드 페이지로
|
|
|
+// mav.setViewName("dashboard");
|
|
|
+// } else {
|
|
|
+// // 운영서버에서만 2factor인증 진행
|
|
|
+// if ("run".equals(env.getProperty("spring.profiles.active")) || "style".equals(env.getProperty("spring.profiles.active"))) {
|
|
|
+// // 2factor인증번호 발송
|
|
|
+// loginService.sendTwoFactorCertNo();
|
|
|
+//
|
|
|
+// // 2factor인증 페이지로
|
|
|
+// mav.setViewName("signin2");
|
|
|
+// } else {
|
|
|
+// // 대쉬보드 페이지로
|
|
|
+// mav.setViewName("dashboard");
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ // 공지사항 팝업 총건수
|
|
|
+ mav.addObject("noticeCnt", noticeService.getNoticePopupTotalCount());
|
|
|
+
|
|
|
+ // 대쉬보드 페이지로
|
|
|
+ mav.setViewName("dashboard");
|
|
|
+
|
|
|
return mav;
|
|
|
}
|
|
|
|
|
|
@@ -170,4 +181,23 @@ public class TssIndexController extends TssBaseController {
|
|
|
return super.ok(message.getMessage("SUCC_0009"));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 공급벤더 사용자 계정 비밀번호 초기화
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/svuser/password/reset")
|
|
|
+ @ResponseBody
|
|
|
+ public String resetSupplyVendorPassword() {
|
|
|
+ Collection<User> userList = loginService.getSupplyVendorUserList();
|
|
|
+
|
|
|
+ if (userList != null && !userList.isEmpty()) {
|
|
|
+ for (User user : userList) {
|
|
|
+ user.setPasswd(GagaCryptoUtil.encryptSha512(user.getUserId() + "_st24"));
|
|
|
+ loginService.createSupplyVendorUserPassword(user);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return "OK";
|
|
|
+ }
|
|
|
+
|
|
|
}
|