Commit d4265084 authored by 黎博's avatar 黎博

debug-修改获取BufferedReader br = null;

parent 2f03f21e
...@@ -39,14 +39,38 @@ public class PayInterceptor implements HandlerInterceptor { ...@@ -39,14 +39,38 @@ public class PayInterceptor implements HandlerInterceptor {
* @return * @return
* @throws IOException * @throws IOException
*/ */
private String getRequestBody(HttpServletRequest request) throws IOException { private String getRequestBody(HttpServletRequest request) {
BufferedReader br = request.getReader(); BufferedReader br = null;
String str; StringBuilder sb = new StringBuilder("");
StringBuilder wholeStr = new StringBuilder(); try
while((str = br.readLine()) != null){ {
wholeStr.append(str); br = request.getReader();
String str;
while ((str = br.readLine()) != null)
{
sb.append(str);
}
br.close();
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
if (null != br)
{
try
{
br.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
} }
return wholeStr.toString(); 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