Browse Source

增加获取请求的所有参数方法

dsx 1 year ago
parent
commit
c7fc6988d9

+ 1 - 1
4dkankan-common-web/src/main/java/com/fdkankan/web/util/WebUtil.java

@@ -36,7 +36,7 @@ public class WebUtil {
     public static String getParameter(String paramName, JoinPoint pjp, HttpServletRequest request){
         Object[] args = pjp.getArgs();
         String contentType = request.getContentType();
-        if(contentType.contains(ContentType.JSON.getValue())){
+        if(StrUtil.isNotEmpty(contentType) && contentType.contains(ContentType.JSON.getValue())){
             HashMap hashMap = JSON.parseObject(JSON.toJSONString(args[0]), HashMap.class);
             return (String) hashMap.get(paramName);
         }