写入日志时精确到秒 10/26 wzq

master
wzqgit 4 years ago
parent 50bb0eec92
commit 2df678463c

@ -47,7 +47,7 @@ public class LogServiceImpl implements LogService {
log.setCreater(user.getUserName());
}
// 获取系统当前时间
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm");
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
log.setCreateDate(fmt.format(new Date()));
//获取IP
String ipAddress = getAddressIp(request);
@ -58,7 +58,7 @@ public class LogServiceImpl implements LogService {
@Override
public void autoInsert(Power_Log log) {
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm");
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
log.setCreateDate(fmt.format(new Date()));
log.setSysFlag("power");
logMapper.insert(log);

Loading…
Cancel
Save