jiangping
2023-10-16 9ab4955166b7b1370fc2a49b152353241ca9e64a
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package doumeemes.config.shiro;
 
import doumeemes.core.model.LoginUserInfo;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.springframework.stereotype.Component;
 
/**
 * 自定义Token ,处理认证和权限
 * @author Eva.Caesar Liu
 * @date 2022/04/18 18:12
 */
@Component
public class ShiroToken extends UsernamePasswordToken {
 
    /**
     * 公司ID
     */
    Integer companyId;
    Boolean isDdLogin;
    Boolean isWxLogin;
    LoginUserInfo updateUser;
 
    int updateFlag;
 
    public ShiroToken() {
    }
    public ShiroToken(Integer companyId, String username, String password, boolean isDdLogin, boolean isWxLogin) {
        super(username,  password, false, (String)null);
        this.companyId = companyId;
        this.isDdLogin = isDdLogin;
        this.isWxLogin = isWxLogin;
    }
    public ShiroToken(LoginUserInfo user,int updateFlag) {
        super(user.getUsername(), "", false, (String)null);
        this.updateUser = user;
        this.updateFlag = updateFlag;
        this.isDdLogin = true;
    }
 
    public Boolean getDdLogin() {
        return isDdLogin;
    }
 
    public void setDdLogin(Boolean ddLogin) {
        isDdLogin = ddLogin;
    }
 
 
    public Boolean getWxLogin() {
        return isWxLogin;
    }
 
    public void setWxLogin(Boolean wxLogin) {
        isWxLogin = wxLogin;
    }
 
    public Integer getCompanyId() {
        return companyId;
    }
 
    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }
 
    public LoginUserInfo getUpdateUser() {
        return updateUser;
    }
 
    public void setUpdateUser(LoginUserInfo updateUser) {
        this.updateUser = updateUser;
    }
 
    public int getUpdateFlag() {
        return updateFlag;
    }
 
    public void setUpdateFlag(int updateFlag) {
        this.updateFlag = updateFlag;
    }
}