RuoYi
2022-01-14 6b4d03cb8df99b6a346b1beb0bd3467de0d888c2
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ServletUtils.java
@@ -64,6 +64,22 @@
    }
    /**
     * 获取Boolean参数
     */
    public static Boolean getParameterToBool(String name)
    {
        return Convert.toBool(getRequest().getParameter(name));
    }
    /**
     * 获取Boolean参数
     */
    public static Boolean getParameterToBool(String name, Boolean defaultValue)
    {
        return Convert.toBool(getRequest().getParameter(name), defaultValue);
    }
    /**
     * 获取request
     */
    public static HttpServletRequest getRequest()
@@ -112,6 +128,16 @@
        {
            return null;
        }
    }
    public static String getHeader(HttpServletRequest request, String name)
    {
        String value = request.getHeader(name);
        if (StringUtils.isEmpty(value))
        {
            return StringUtils.EMPTY;
        }
        return urlDecode(value);
    }
    public static Map<String, String> getHeaders(HttpServletRequest request)
@@ -200,7 +226,7 @@
        }
        catch (UnsupportedEncodingException e)
        {
            return "";
            return StringUtils.EMPTY;
        }
    }
@@ -218,7 +244,7 @@
        }
        catch (UnsupportedEncodingException e)
        {
            return "";
            return StringUtils.EMPTY;
        }
    }