Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev

 Conflicts:
	ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java
	ruoyi-ui/src/api/login.js
This commit is contained in:
疯狂的狮子li
2021-08-30 12:49:19 +08:00
4 changed files with 16 additions and 9 deletions

View File

@ -65,8 +65,8 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
// xss过滤
json = HtmlUtil.cleanHtmlTag(json).trim();
final ByteArrayInputStream bis = IoUtil.toStream(json, StandardCharsets.UTF_8);
byte[] jsonBytes = json.getBytes(StandardCharsets.UTF_8);
final ByteArrayInputStream bis = IoUtil.toStream(jsonBytes);
return new ServletInputStream()
{
@Override
@ -81,6 +81,12 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
return true;
}
@Override
public int available() throws IOException
{
return jsonBytes.length;
}
@Override
public void setReadListener(ReadListener readListener)
{
@ -104,4 +110,4 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
String header = super.getHeader(HttpHeaders.CONTENT_TYPE);
return StringUtils.startsWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE);
}
}
}