public void updateLogin(
AuthenticationSuccessEvent authenticationSuccessEvent) {
UserDAO userDAO = (UserDAO) getDao();
String username = authenticationSuccessEvent.getAuthentication().getName();
BaseUser user = userDAO.loadByUsername(username);
WebAuthenticationDetails details = (WebAuthenticationDetails) authenticationSuccessEvent.getAuthentication().getDetails();
String address = details.getRemoteAddress();
if (user.getTotalLoginCount()== null)
user.setTotalLoginCount(1l);
else
user.setTotalLoginCount(user.getTotalLoginCount()+1);
user.setPrevLoginIP(user.getLastLoginIP());