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;
StringBuilder sb = new StringBuilder("");
try
{
br = request.getReader();
String str; String str;
StringBuilder wholeStr = new StringBuilder(); while ((str = br.readLine()) != null)
while((str = br.readLine()) != null){ {
wholeStr.append(str); sb.append(str);
} }
return wholeStr.toString(); 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