|
|
@@ -11,7 +11,6 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
|
|
|
|
-
|
|
|
public class DeviceFilter extends AccessControlFilter{
|
|
|
|
|
|
@Autowired
|
|
|
@@ -23,7 +22,8 @@ public class DeviceFilter extends AccessControlFilter{
|
|
|
@Override
|
|
|
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue)
|
|
|
throws Exception {
|
|
|
- if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || !request.getServerName().startsWith("m")){
|
|
|
+ if (!shiroFilterUtils.isFromAPP((HttpServletRequest)request) && shiroFilterUtils.isMobileDevice((HttpServletRequest)request)
|
|
|
+ && !request.getServerName().startsWith("m")){
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
@@ -31,7 +31,8 @@ public class DeviceFilter extends AccessControlFilter{
|
|
|
|
|
|
@Override
|
|
|
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
|
|
|
- if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || !request.getServerName().startsWith("m")){
|
|
|
+ if (!shiroFilterUtils.isFromAPP((HttpServletRequest)request) && shiroFilterUtils.isMobileDevice((HttpServletRequest)request)
|
|
|
+ && !request.getServerName().startsWith("m")){
|
|
|
LoggerUtils.debug(getClass(), "当前访问为移动设备");
|
|
|
WebUtils.issueRedirect(request, response, mobileWebsite,null,false);
|
|
|
}
|