优化访问日志提交的数据,当参数名重复的时候只记录了一个的问题
This commit is contained in:
@@ -235,9 +235,15 @@ public class Log extends DataEntity<Log> {
|
|||||||
}
|
}
|
||||||
StringBuilder params = new StringBuilder();
|
StringBuilder params = new StringBuilder();
|
||||||
for (Map.Entry<String, String[]> param : ((Map<String, String[]>)paramsMap).entrySet()){
|
for (Map.Entry<String, String[]> param : ((Map<String, String[]>)paramsMap).entrySet()){
|
||||||
params.append(("".equals(params.toString()) ? "" : "&") + param.getKey() + "=");
|
if (params.length() != 0) {
|
||||||
String paramValue = (param.getValue() != null && param.getValue().length > 0 ? param.getValue()[0] : "");
|
params.append("&");
|
||||||
params.append(StringUtils.abbr(StringUtils.endsWithIgnoreCase(param.getKey(), "password") ? "*" : paramValue, 1000));
|
}
|
||||||
|
params.append(param.getKey() + "=");
|
||||||
|
if (StringUtils.endsWithIgnoreCase(param.getKey(), "password")){
|
||||||
|
params.append("*");
|
||||||
|
}else if (param.getValue() != null) {
|
||||||
|
params.append(StringUtils.abbr(StringUtils.join(param.getValue(), ","), 1000));
|
||||||
|
}
|
||||||
this.paramsMap.put(param.getKey(), param.getValue());
|
this.paramsMap.put(param.getKey(), param.getValue());
|
||||||
}
|
}
|
||||||
this.requestParams = params.toString();
|
this.requestParams = params.toString();
|
||||||
|
|||||||
Reference in New Issue
Block a user