diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/goods/GoodsController.java b/ghy-admin/src/main/java/com/ghy/web/controller/goods/GoodsController.java index 897aeb55..0d851e1d 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/goods/GoodsController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/goods/GoodsController.java @@ -8,7 +8,6 @@ import com.ghy.common.core.page.TableDataInfo; import com.ghy.common.enums.BusinessType; import com.ghy.common.utils.ShiroUtils; import com.ghy.common.utils.poi.ExcelUtil; -import com.ghy.goods.domain.DeptGoodsCategory; import com.ghy.goods.domain.Goods; import com.ghy.goods.service.DeptGoodsCategoryService; import com.ghy.goods.service.GoodsService; @@ -38,7 +37,7 @@ public class GoodsController extends BaseController { return PREFIX + "/goods"; } - @RequiresPermissions("goods:goods:list") +// @RequiresPermissions("goods:goods:list") @PostMapping("/list") @ResponseBody public TableDataInfo list(Goods goods) { diff --git a/ghy-common/src/main/java/com/ghy/common/utils/ServletUtils.java b/ghy-common/src/main/java/com/ghy/common/utils/ServletUtils.java index 994634c3..8410bc97 100644 --- a/ghy-common/src/main/java/com/ghy/common/utils/ServletUtils.java +++ b/ghy-common/src/main/java/com/ghy/common/utils/ServletUtils.java @@ -11,7 +11,7 @@ import com.ghy.common.core.text.Convert; /** * 客户端工具类 - * + * * @author clunt */ public class ServletUtils @@ -26,7 +26,7 @@ public class ServletUtils */ public static String getParameter(String name) { - return getRequest().getParameter(name); + return StringUtils.isNotEmpty(getRequest().getHeader(name)) ? getRequest().getHeader(name):getRequest().getParameter(name); } /** @@ -34,7 +34,8 @@ public class ServletUtils */ public static String getParameter(String name, String defaultValue) { - return Convert.toStr(getRequest().getParameter(name), defaultValue); + String value = StringUtils.isNotEmpty(getRequest().getHeader(name)) ? getRequest().getHeader(name):getRequest().getParameter(name); + return Convert.toStr(value, defaultValue); } /** @@ -42,7 +43,8 @@ public class ServletUtils */ public static Integer getParameterToInt(String name) { - return Convert.toInt(getRequest().getParameter(name)); + String value = StringUtils.isNotEmpty(getRequest().getHeader(name)) ? getRequest().getHeader(name):getRequest().getParameter(name); + return Convert.toInt(value); } /** @@ -50,7 +52,8 @@ public class ServletUtils */ public static Integer getParameterToInt(String name, Integer defaultValue) { - return Convert.toInt(getRequest().getParameter(name), defaultValue); + String value = StringUtils.isNotEmpty(getRequest().getHeader(name)) ? getRequest().getHeader(name):getRequest().getParameter(name); + return Convert.toInt(value, defaultValue); } /** @@ -58,7 +61,8 @@ public class ServletUtils */ public static Boolean getParameterToBool(String name) { - return Convert.toBool(getRequest().getParameter(name)); + String value = StringUtils.isNotEmpty(getRequest().getHeader(name)) ? getRequest().getHeader(name):getRequest().getParameter(name); + return Convert.toBool(value); } /** @@ -66,7 +70,8 @@ public class ServletUtils */ public static Boolean getParameterToBool(String name, Boolean defaultValue) { - return Convert.toBool(getRequest().getParameter(name), defaultValue); + String value = StringUtils.isNotEmpty(getRequest().getHeader(name)) ? getRequest().getHeader(name):getRequest().getParameter(name); + return Convert.toBool(value, defaultValue); } /** @@ -101,7 +106,7 @@ public class ServletUtils /** * 将字符串渲染到客户端 - * + * * @param response 渲染对象 * @param string 待渲染的字符串 * @return null @@ -123,7 +128,7 @@ public class ServletUtils /** * 是否是Ajax异步请求 - * + * * @param request */ public static boolean isAjaxRequest(HttpServletRequest request) diff --git a/ghy-framework/src/main/java/com/ghy/framework/config/ShiroConfig.java b/ghy-framework/src/main/java/com/ghy/framework/config/ShiroConfig.java index cad7ed66..30256a42 100644 --- a/ghy-framework/src/main/java/com/ghy/framework/config/ShiroConfig.java +++ b/ghy-framework/src/main/java/com/ghy/framework/config/ShiroConfig.java @@ -39,7 +39,7 @@ import at.pollux.thymeleaf.shiro.dialect.ShiroDialect; /** * 权限配置加载 - * + * * @author clunt */ @Configuration