CustomToken.java
1.17 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
package com.glsx.usercenter.shiro;
import org.apache.shiro.authc.UsernamePasswordToken;
import com.glsx.usercenter.constants.LoginType;
/**
*
* @Title CustomToken.java
* @Package com.glsx.usercenter.shiro
* @Description TODO 免密验证
* @author zhanghj
* @date 2019年4月25日 上午10:18:41
* @version 1.0.0
*/
public class CustomToken extends UsernamePasswordToken{
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;
}
}