소스 검색

Merge branch 'test' of jishutao/jitao-server into prod

gitadmin 7 년 전
부모
커밋
8b336a2450
1개의 변경된 파일2개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 6
      src/main/java/com/goafanti/core/shiro/filter/DeviceFilter.java

+ 2 - 6
src/main/java/com/goafanti/core/shiro/filter/DeviceFilter.java

@@ -23,8 +23,7 @@ public class DeviceFilter extends  AccessControlFilter{
 	@Override
 	protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue)
 			throws Exception {
-		// TODO Auto-generated method stub
-		if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || request.getServerName().indexOf("m.") > 0){
+		if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || request.getServerName().startsWith("m.")){
 			return false;
 		}
 		return true;
@@ -32,13 +31,10 @@ public class DeviceFilter extends  AccessControlFilter{
 
 	@Override
 	protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
-		// TODO Auto-generated method stub
-		if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || request.getServerName().indexOf("m.") > 0){
+		if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || request.getServerName().startsWith("m.")){
 			LoggerUtils.debug(getClass(), "当前访问为移动设备");
 			WebUtils.issueRedirect(request, response, mobileWebsite,null,false);
 		}
 		return false;
 	}
-
-	
 }