CustomToken.java 1.17 KB
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;
	    }
}