로그아웃 로그 수정

master
mjkhan21 9 months ago
parent 99953cee6f
commit 927e0852b8

@ -6,6 +6,7 @@ import java.util.List;
import cokr.xit.foundation.Access;
import cokr.xit.foundation.Assert;
import cokr.xit.foundation.LocalHost;
import cokr.xit.foundation.UserInfo;
/**
@ -22,7 +23,7 @@ public class ServiceCall {
if (call == null) {
cache.set(call = new ServiceCall());
call.userId = UserInfo.current().getId();
call.ipAddress = Access.current().getIpAddress();
call.ipAddress = Assert.ifEmpty(Access.current().getIpAddress(), LocalHost::getAddress);
}
return call;
}

@ -11,6 +11,7 @@ import cokr.xit.base.file.web.DownloadView;
import cokr.xit.base.file.web.XLSView;
import cokr.xit.base.syslog.ServiceLog;
import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.data.DataObject;
/** .
@ -67,6 +68,11 @@ public class LogFilter extends AbstractComponent {
case "onFailure":
case "onLogout":
log.setType(ServiceLog.LOG_INOUT);
UserInfo current = UserInfo.current();
if (!current.isAuthenticated()) {
Object[] args = log.getArgs();
log.setUserId(current.getId(args.length > 0 ? args[0] : null));
}
return true;
default: return false;
}

Loading…
Cancel
Save