mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-20 10:25:00 +08:00
管理员日志重构--修改入参获取不到问题
This commit is contained in:
parent
93752a9ca7
commit
b58ee9dbc6
@ -102,6 +102,12 @@ public class AdminLogAspect {
|
||||
if (StringUtil.isNotEmpty(parameterMap)) {
|
||||
String params = JSONUtil.toJsonStr(parameterMap);
|
||||
adminLog.setParam(StringUtils.substring(params, 0, 2000));
|
||||
}else {
|
||||
Object[] args = joinPoint.getArgs();
|
||||
if (StringUtil.isNotNull(args)) {
|
||||
String params = StringUtil.arrayToString(args);
|
||||
adminLog.setParam(StringUtils.substring(params, 0, 2000));
|
||||
}
|
||||
}
|
||||
adminLog.setResult(JSONUtil.toJsonStr(jsonResult));
|
||||
adminLog.setIp(IpUtil.getIpAddress());
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package xyz.playedu.api.util;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
|
||||
import java.util.*;
|
||||
@ -527,4 +528,20 @@ public class StringUtil extends org.apache.commons.lang3.StringUtils {
|
||||
sbuf.append(strPattern, handledPosition, strPattern.length());
|
||||
return sbuf.toString();
|
||||
}
|
||||
|
||||
public static String arrayToString(Object[] array) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
if (array != null && array.length > 0) {
|
||||
for (Object o : array) {
|
||||
if (StringUtil.isNotNull(o)) {
|
||||
try {
|
||||
Object jsonObj = JSONUtil.toJsonStr(o);
|
||||
result.append(jsonObj.toString());
|
||||
}
|
||||
catch (Exception e) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user