|
|
@@ -3,16 +3,17 @@ package com.style24.front.support.interceptor;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.core.env.Environment;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
|
|
|
|
|
+import com.gagaframework.web.util.GagaStringUtil;
|
|
|
import com.style24.front.support.security.session.TsfSession;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
-import com.gagaframework.web.util.GagaStringUtil;
|
|
|
-
|
|
|
/**
|
|
|
* 모든 Request에 대한 선처리
|
|
|
*
|
|
|
@@ -27,6 +28,9 @@ public class TsfDefaultInterceptor extends HandlerInterceptorAdapter {
|
|
|
|
|
|
// @Autowired
|
|
|
// private TsfPolicyService policyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private Environment env;
|
|
|
|
|
|
@Override
|
|
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
|
|
@@ -59,11 +63,15 @@ public class TsfDefaultInterceptor extends HandlerInterceptorAdapter {
|
|
|
// 1.웹으로 접근하고
|
|
|
// 2.특정IP(아이스타일본사: 180.71.39.150, 한세엠케이: 106.251.248.202, 한세드림: 218.144.146.18)가 아니면
|
|
|
String ipAddr = TsfSession.getIpAddress();
|
|
|
+ String active = env.getProperty("spring.profiles.active");
|
|
|
+
|
|
|
log.info("IP Address: [{}]", ipAddr);
|
|
|
if (TsfSession.getAttribute("isApp").equals("false") &&
|
|
|
!ipAddr.equals("180.71.39.150") &&
|
|
|
!ipAddr.equals("106.251.248.202") &&
|
|
|
- !ipAddr.equals("218.144.146.18")) {
|
|
|
+ !ipAddr.equals("218.144.146.18") &&
|
|
|
+ !"locd".equals(active) &&
|
|
|
+ !"tsit".equals(active)) {
|
|
|
response.sendRedirect("https://m.istyle24.com");
|
|
|
return false;
|
|
|
}
|