update 优化 编译警告问题 替换过期方法与类

This commit is contained in:
疯狂的狮子Li
2025-01-17 10:49:32 +08:00
parent 0ae521a7dc
commit 8c57d694c5
5 changed files with 11 additions and 10 deletions

View File

@ -113,13 +113,12 @@ public class LogAspect {
// 设置消耗时间
StopWatch stopWatch = KEY_CACHE.get();
stopWatch.stop();
operLog.setCostTime(stopWatch.getTime());
operLog.setCostTime(stopWatch.getDuration().toMillis());
// 发布事件保存数据库
SpringUtils.context().publishEvent(operLog);
} catch (Exception exp) {
// 记录本地异常日志
log.error("异常信息:{}", exp.getMessage());
exp.printStackTrace();
} finally {
KEY_CACHE.remove();
}