瀏覽代碼

配置修改,成果增加行业判断

anderx 7 年之前
父節點
當前提交
3d9e7ff57a

+ 4 - 1
src/main/java/com/goafanti/app/controller/AppUserController.java

@@ -675,7 +675,10 @@ public class AppUserController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到数据类别", "数据类别"));
 			return res;
 		}
-
+		if (null == ia.getFieldA()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到行业", "行业"));
+			return res;
+		}
 		if (StringUtils.isBlank(ia.getKeyword())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
 			return res;

+ 4 - 3
src/main/java/com/goafanti/core/shiro/filter/DeviceFilter.java

@@ -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);
 		}