[代码完善](v2.5): v2.5 beta 审计获取当前操作人优化

2.5 Beta 详情:https://www.ydyno.com/archives/1225.html
pull/372/head
ZhengJie 2020-05-14 14:07:25 +08:00
parent 90a4a80a7f
commit 2d969b43a5
1 changed files with 6 additions and 2 deletions

View File

@ -35,7 +35,11 @@ public class AuditorConfig implements AuditorAware<String> {
*/
@Override
public Optional<String> getCurrentAuditor() {
try {
// 这里应根据实际业务情况获取具体信息
return Optional.of(SecurityUtils.getCurrentUsername());
}catch (Exception ignored){}
// 用户定时任务或者无Token调用的情况
return Optional.of("System");
}
}