86183
2022-09-09 0d999e33085c0a25c5525242748f6aa62a401159
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
 
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 {
 
    /**
     * 处理登录成功方法
     * <p>
     * 获取到登录的authentication 对象
     *
     * @param authentication 登录对象
     */
    @Override
    public void handle(Authentication authentication) {
        log.info("用户:{} 登录成功", authentication.getPrincipal());
    }
 
}