Commit 7a45ef0c authored by 黎博's avatar 黎博

debug-修改获取HttpServletRequest Body的方法

parent d4265084
...@@ -39,38 +39,14 @@ public class PayInterceptor implements HandlerInterceptor { ...@@ -39,38 +39,14 @@ public class PayInterceptor implements HandlerInterceptor {
* @return * @return
* @throws IOException * @throws IOException
*/ */
private String getRequestBody(HttpServletRequest request) { private String getRequestBody(HttpServletRequest request) throws IOException {
BufferedReader br = null; BufferedReader br = request.getReader();
StringBuilder sb = new StringBuilder(""); String str = "";
try String listString = "";
{ while ((str = br.readLine()) != null) {
br = request.getReader(); listString += str;
String str; }
while ((str = br.readLine()) != null) return listString;
{
sb.append(str);
}
br.close();
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
if (null != br)
{
try
{
br.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
return sb.toString();
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment