CustomToken.java
1.27 KB
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
package com.glsx.usercenter.shiro;
import com.glsx.usercenter.constants.LoginType;
import org.apache.shiro.authc.UsernamePasswordToken;
/**
* @author zhanghj
* @version 1.0.0
* @Title CustomToken.java
* @Package com.glsx.usercenter.shiro
* @Description TODO 免密验证
* @date 2019年4月25日 上午10:18:41
*/
public class CustomToken extends UsernamePasswordToken {
/**
*
*/
private static final long serialVersionUID = 2923776642963464990L;
private LoginType type;
public CustomToken() {
super();
}
public CustomToken(String username, String password, LoginType type, boolean rememberMe, String host) {
super(username, password, rememberMe, host);
this.type = type;
}
/**
* 免密登录
*/
public CustomToken(String username) {
super(username, "", false, null);
this.type = LoginType.NOPASSWD;
}
/**
* 账号密码登录
*/
public CustomToken(String username, String pwd) {
super(username, pwd, false, null);
this.type = LoginType.PASSWORD;
}
public LoginType getType() {
return type;
}
public void setType(LoginType type) {
this.type = type;
}
}