mirror of
https://github.com/jeequan/jeepay
synced 2024-11-17 23:08:03 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
a7231b5b44
@ -49,20 +49,27 @@ public class RequestKitBean {
|
||||
/** reqContext对象中的key: 转换好的json对象 */
|
||||
private static final String REQ_CONTEXT_KEY_PARAMJSON = "REQ_CONTEXT_KEY_PARAMJSON";
|
||||
|
||||
/**request.getParameter 获取参数 并转换为JSON格式 **/
|
||||
/** JSON 格式通过请求主体(BODY)传输 获取参数 **/
|
||||
public String getReqParamFromBody() {
|
||||
|
||||
String body = "";
|
||||
try {
|
||||
String str;
|
||||
while((str = request.getReader().readLine()) != null){
|
||||
body += str;
|
||||
|
||||
if(isConvertJSON()){
|
||||
|
||||
try {
|
||||
String str;
|
||||
while((str = request.getReader().readLine()) != null){
|
||||
body += str;
|
||||
}
|
||||
|
||||
return body;
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("请求参数转换异常! params=[{}]", body);
|
||||
throw new BizException(ApiCodeEnum.PARAMS_ERROR, "转换异常");
|
||||
}
|
||||
|
||||
}else {
|
||||
return body;
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("请求参数转换异常! params=[{}]", body);
|
||||
throw new BizException(ApiCodeEnum.PARAMS_ERROR, "转换异常");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user