fix: 로그인 요청인 경우만 메뉴목록과 공지사항 조회 하도록 변경

main
Jonguk. Lim 2 years ago
parent f5338ecbc2
commit a3c9d7fa43

@ -2,6 +2,7 @@ package kr.xit.framework.core.interceptor;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -23,14 +24,19 @@ import kr.xit.framework.support.util.constants.MessageKey;
import lombok.extern.slf4j.Slf4j;
/**
*
* <pre>
* @: Interceptor
* @: .
* @: 2020. 3. 24. 4:33:06
* @:
* @
*
* , return
* return
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
* </pre>
*/
@Slf4j
@Service
@ -44,25 +50,17 @@ public class MenuIntercepter extends HandlerInterceptorAdapter {
*/
@SuppressWarnings("unused")
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView mv) throws Exception
{
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView mv) throws Exception {
if(mv==null) //return page가 없으면 stop
return;
if(mv == null) return;
log.debug("MenuIntercepter interceptor START !!");
/**
*
*/
//타일즈 적용 여부
String viewName = mv.getViewName();
boolean isTiles = (viewName.endsWith(TILES_TYPE.NONE.getVal())||viewName.endsWith(TILES_TYPE.POPUP.getVal())||viewName.endsWith(TILES_TYPE.FIMS_POPUP.getVal()))? false: true;
//사용자의 인증 여부 확인
boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
String reqPath = request.getRequestURI();//.split("\\.")[0];
/**
*
*/
@ -83,67 +81,32 @@ public class MenuIntercepter extends HandlerInterceptorAdapter {
allMenuList = CacheServiceUtils.findMenuListByAuthorCode("ROLE_ANONYMOUS");
}
// main page만 메뉴목록 / 공지사항 조회
if(reqPath.contains("/framework/biz/cmm/mainPage")) {
mv.addObject("allMenuList", allMenuList);
//요청페이지 URL GET
String url = request.getRequestURI();
// String[] arrUrl = url.split("/");
// String[] jobUrl = arrUrl[arrUrl.length-1].split("_");
// String jobSort = jobUrl[0];
// String chkUrl = "/";
// for(int i=1; i < arrUrl.length-1; i++) {
// chkUrl += arrUrl[i] + "/";
// }
// chkUrl += jobSort;
// if(chkUrlAddLength.containsKey(chkUrl)) {
// int addLength = chkUrlAddLength.get(chkUrl);
// for(int i=1; i<=addLength; i++)
// chkUrl += "_"+jobUrl[i];
// XitRollingNotiVO notiVO = xitRollingNotiVO;
// if(XitCmmnUtil.notEmpty(notiVO.getBbsId())) { //BBS_ID 값이 없으면 롤링 미사용으로 간주(globals.properties의 Globals.Xit.RollingNotiBbsId 에서 설정 가능)
// notiVO.setList(xitFrameUnitService.findLatestBbsList(false));
// mv.addObject("rollingNotiList", notiVO.getList());
// }
// //요청페이지 URL에서 ContextPath 제거
// String contextPath = request.getContextPath();
// if(!"/".equals(contextPath))
// chkUrl = chkUrl.substring(contextPath.length());
mv.addObject("rollingNotiList", CacheServiceUtils.findLatestBbsList());
}
//요청페이지 정보 Setting
for(int i=0; i < allMenuList.size(); i++) {
Map<String, String> mUrlInfo = allMenuList.get(i);
// if (mUrlInfo.get("menuUrl").toString().contains(chkUrl)) {
if (Checks.isNotEmpty(mUrlInfo.get("menuUrl")) && mUrlInfo.get("menuUrl").toString().contains(url)) {
log.info("RequestURL Matched OK !!");
if (Checks.isNotEmpty(mUrlInfo.get("menuUrl")) && mUrlInfo.get("menuUrl").toString().contains(reqPath)) {
String[] arrPath = mUrlInfo.get("menuPath").toString().split("_");
mUrlInfo.put("secondMenu", arrPath[1]);
mv.addObject("urlInfoMap", mUrlInfo);
break;
}
}
mv.addObject("allMenuList", allMenuList);
/**
* Rolling
*/
// XitRollingNotiVO notiVO = xitRollingNotiVO;
// if(XitCmmnUtil.notEmpty(notiVO.getBbsId())) { //BBS_ID 값이 없으면 롤링 미사용으로 간주(globals.properties의 Globals.Xit.RollingNotiBbsId 에서 설정 가능)
// notiVO.setList(xitFrameUnitService.findLatestBbsList(false));
// mv.addObject("rollingNotiList", notiVO.getList());
// }
mv.addObject("rollingNotiList", CacheServiceUtils.findLatestBbsList());
}
log.debug("MenuIntercepter interceptor COMPLETE !!");
}
//@Resource
//private XitRollingNotiVO xitRollingNotiVO;
public Map<String, Integer> getChkUrlAddLength() {
return chkUrlAddLength;
}

Loading…
Cancel
Save