黎星凯
2024-05-17 3520e86e2b00b9c1ee3f4fffd4ab49fe3d6c259e
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
30
31
package com.iplatform.security;
 
import com.iplatform.base.pojo.RequestLogin;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 
/**
 * 重写默认的认证token对象,添加自定义属性。
 * @author 时克英
 * @date 2023-01-27
 */
public class DefaultAuthenticationToken extends UsernamePasswordAuthenticationToken {
 
    private RequestLogin requestLogin;
 
    /**
     * 返回请求登录提交的原始数据
     * @return
     */
    public RequestLogin getRequestLogin() {
        return requestLogin;
    }
 
    public DefaultAuthenticationToken(Object principal, Object credentials) {
        super(principal, credentials);
    }
 
    public DefaultAuthenticationToken(Object principal, Object credentials, RequestLogin requestLogin){
        super(principal, credentials);
        this.requestLogin = requestLogin;
    }
}