package com.nbclass.shiro.config;

import org.apache.shiro.authc.UsernamePasswordToken;

/**
 * 
 * @author Leon
 * @datetime 2019年4月22日 下午8:59:23
 */
public class MyUsernamePasswordToken extends UsernamePasswordToken {

	private static final long serialVersionUID = 1744966815127132051L;

	private LoginType type;

    public MyUsernamePasswordToken() {
        super();
    }

    public MyUsernamePasswordToken(String username, String password, LoginType type, boolean rememberMe, String host) {
    	super(username, password, rememberMe,  host);
        this.type = type;
    }
    
    /**免密登录*/
    public MyUsernamePasswordToken(String username) {
        super(username, "", false, null);
        this.type = LoginType.NOPASSWD;
    }
    
    /**账号密码登录*/
    public MyUsernamePasswordToken(String username, String password) {
        super(username, password, false, null);
        this.type = LoginType.PASSWORD;
    }

    public LoginType getType() {
        return type;
    }

    public void setType(LoginType type) {
        this.type = type;
    }
    
}
