Merge branch 'master' of http://118.219.150.34:50501/DBNT/kcscDev into thkim

thkim
thkim 2024-01-24 18:02:51 +09:00
commit 4fc4240ded
5 changed files with 56 additions and 21 deletions

View File

@ -316,6 +316,16 @@
.BRD011 .result .list_item > div:nth-child(12) {width: 60px;} .BRD011 .result .list_item > div:nth-child(12) {width: 60px;}
.BRD011 .result .list_item > div:nth-child(13) {width: 60px;} .BRD011 .result .list_item > div:nth-child(13) {width: 60px;}
/* 건설기준관리 - API키 관리*/
.BRD012 .head > span:nth-child(1) {width: 100px;}
.BRD012 .head > span:nth-child(2) {width: 360px;}
.BRD012 .head > span:nth-child(3) {width: 200px;}
.BRD012 .head > span:nth-child(4) {width: 150px;}
.BRD012 .result .list_item > div:nth-child(1) {width: 100px;}
.BRD012 .result .list_item > div:nth-child(2) {width: 360px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}
.BRD012 .result .list_item > div:nth-child(3) {width: 200px;}
.BRD012 .result .list_item > div:nth-child(4) {width: 150px;}
/* 게시판 사용관리 등록 */ /* 게시판 사용관리 등록 */
.BOARD_USE_LIST .board_view2 dl dt {width: 185px;} .BOARD_USE_LIST .board_view2 dl dt {width: 185px;}
.BOARD_USE_LIST .board_view2 dl:nth-child(2) dd .f_input2 {width: 490px; margin-left: 17px;} .BOARD_USE_LIST .board_view2 dl:nth-child(2) dd .f_input2 {width: 490px; margin-left: 17px;}

View File

@ -480,6 +480,18 @@
.BRD011 .result .list_item > div:nth-child(6)::after {content: ""; display: inline-block; width: 1px; height: 11px; margin-left: 6px; background: #ccc; vertical-align: 0px;} .BRD011 .result .list_item > div:nth-child(6)::after {content: ""; display: inline-block; width: 1px; height: 11px; margin-left: 6px; background: #ccc; vertical-align: 0px;}
.BRD011 .result .list_item > div:nth-child(6)::after {content: none;} .BRD011 .result .list_item > div:nth-child(6)::after {content: none;}
/* 건설기준관리 - API키 관리*/
.BRD012 .head {display: none;}
.BRD012 .result .list_item {padding: 16px 0; border-bottom: 1px solid #dde2e5;}
.BRD012 .result .list_item > div {border-bottom: 0; font-size: 14px;}
.BRD012 .result .list_item > div:nth-child(1) {display: none;}
.BRD012 .result .list_item > div:nth-child(2) {width: 100%; padding: 0 0 2px 0; font-weight: 700; text-align: left;}
.BRD012 .result .list_item > div:nth-child(3),
.BRD012 .result .list_item > div:nth-child(4),
.BRD012 .result .list_item > div:nth-child(3)::after,
.BRD012 .result .list_item > div:nth-child(4)::after,
.BOARD_USE_LIST .board_view2 dl dt {width: 95px;} .BOARD_USE_LIST .board_view2 dl dt {width: 95px;}
.BOARD_USE_LIST .board_view2 dl:nth-child(2) dd .f_select {width: 100%;} .BOARD_USE_LIST .board_view2 dl:nth-child(2) dd .f_select {width: 100%;}
.BOARD_USE_LIST .board_view2 dl:nth-child(2) dd .f_input2 {width: 100%; margin: 15px 0 0 0;} .BOARD_USE_LIST .board_view2 dl:nth-child(2) dd .f_input2 {width: 100%; margin: 15px 0 0 0;}

View File

@ -124,18 +124,22 @@ const RootRoutes = () => {
console.group("jwtAuthentication"); console.group("jwtAuthentication");
console.log("[Start] jwtAuthentication ------------------------------"); console.log("[Start] jwtAuthentication ------------------------------");
const jwtAuthURL = "/uat/esm/jwtAuthAPI.do"; const jwtAuthURL = "/auth/token-check";
let requestOptions = { let requestOptions = {
method: "POST", method: "POST",
}; };
EgovNet.requestFetch(jwtAuthURL, requestOptions, (resp) => { EgovNet.requestFetch(
jwtAuthURL,
requestOptions,
(resp) => {
if (resp === false) { if (resp === false) {
setMounted(false); setMounted(false);
} else { } else {
setMounted(true); // true . setMounted(true); // true .
} }
}); }
);
console.log("------------------------------jwtAuthentication [End]"); console.log("------------------------------jwtAuthentication [End]");
console.groupEnd("jwtAuthentication"); console.groupEnd("jwtAuthentication");

View File

@ -8,6 +8,9 @@ import com.dbnt.kcscbackend.config.common.ResponseCode;
import com.dbnt.kcscbackend.config.common.ResultVO; import com.dbnt.kcscbackend.config.common.ResultVO;
import com.dbnt.kcscbackend.config.egov.EgovMessageSource; import com.dbnt.kcscbackend.config.egov.EgovMessageSource;
import com.dbnt.kcscbackend.config.jwt.EgovJwtTokenUtil; import com.dbnt.kcscbackend.config.jwt.EgovJwtTokenUtil;
import com.dbnt.kcscbackend.config.jwt.redis.RefreshToken;
import com.dbnt.kcscbackend.config.jwt.redis.RefreshTokenRepository;
import io.jsonwebtoken.Claims;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.responses.ApiResponses;
@ -60,15 +63,7 @@ public class EgovLoginApiController extends BaseController {
private EgovLoginService loginService; private EgovLoginService loginService;
private final EgovJwtTokenUtil egovJwtTokenUtil; private final EgovJwtTokenUtil egovJwtTokenUtil;
private final RefreshTokenRepository refreshTokenRepository;
/** EgovMessageSource */
@Resource(name = "egovMessageSource")
EgovMessageSource egovMessageSource;
/** JWT */
@Autowired
private EgovJwtTokenUtil jwtTokenUtil;
@Operation( @Operation(
summary = "회원가입", summary = "회원가입",
@ -177,8 +172,17 @@ public class EgovLoginApiController extends BaseController {
return resultMap; return resultMap;
} }
@RequestMapping("/loginSuccess") @PostMapping("/token-check")
public HashMap<String, Object> loginSuccess(HttpServletRequest request, HttpServletResponse response){ public boolean tokenCheck(HttpServletRequest request, HttpServletResponse response, @AuthenticationPrincipal UserInfo loginVO){
return new HashMap<>(); String clientToken = request.getHeader("Authorization");
RefreshToken refreshToken = refreshTokenRepository.findById(egovJwtTokenUtil.getUserSeqFromToken(clientToken)).orElse(null);
if (refreshToken != null){
String serverToken = refreshToken.getRefreshToken();
if(egovJwtTokenUtil.getUserSeFromToken(clientToken).equals(egovJwtTokenUtil.getUserSeFromToken(serverToken))){
return true;
} }
} }
return false;
}
}

View File

@ -58,6 +58,10 @@ public class EgovJwtTokenUtil implements Serializable{
//retrieve username from jwt token //retrieve username from jwt token
public String getUserSeqFromToken(String token) {
Claims claims = getClaimFromToken(token);
return claims.get("userSeq").toString();
}
public String getUserIdFromToken(String token) { public String getUserIdFromToken(String token) {
Claims claims = getClaimFromToken(token); Claims claims = getClaimFromToken(token);
return claims.get("id").toString(); return claims.get("id").toString();
@ -89,6 +93,7 @@ public class EgovJwtTokenUtil implements Serializable{
// compaction of the JWT to a URL-safe string // compaction of the JWT to a URL-safe string
public String generateToken(UserInfo loginVO, String remoteAddr, Long sec) { public String generateToken(UserInfo loginVO, String remoteAddr, Long sec) {
Map<String, Object> claims = new HashMap<>(); Map<String, Object> claims = new HashMap<>();
claims.put("userSeq", loginVO.getUserSeq());
claims.put("id", loginVO.getUserId()); claims.put("id", loginVO.getUserId());
claims.put("remoteAddr", remoteAddr); claims.put("remoteAddr", remoteAddr);
claims.put("userSe", loginVO.getUserSe() ); claims.put("userSe", loginVO.getUserSe() );