package cn.mb.cloud.auth.handler; import cn.mb.cloud.auth.security.handler.AbstractAuthenticationSuccessEventHandler; import lombok.extern.slf4j.Slf4j; import org.springframework.security.core.Authentication; import org.springframework.stereotype.Component; /** * @author jason */ @Slf4j @Component public class CloudAuthenticationSuccessEventHandler extends AbstractAuthenticationSuccessEventHandler { /** * 处理登录成功方法 *
* 获取到登录的authentication 对象 * * @param authentication 登录对象 */ @Override public void handle(Authentication authentication) { log.info("用户:{} 登录成功", authentication.getPrincipal()); } }