@Override
		protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
	               throws AuthenticationException {
			
			 logger.info("User Login to initialize authenticationToken......");
			User user = null;
		    SimpleAuthenticationInfo info = null;
			// token中储存着输入的用户名和密码
			UsernamePasswordToken upToken = (UsernamePasswordToken)token;
			String username = upToken.getUsername();
			try{
					// 与数据库中用户名和密码进行比对。比对成功则返回info，比对失败则抛出对应信息的异常AuthenticationException
				    user = userService.findUser(username);
				    user = new User();
				    user.setUserName("admin");
				    user.setPassword("test");
					// 用户不存在
					if (user == null || "".equals(user) || "null".equals(user)) {
						 logger.info("The user [" + upToken.getUsername() + "] not found!");
						 throw new UnknownAccountException("The user [" + upToken.getUsername() + "] not found!");
					} else if(user.getPassword().equals(new String(upToken.getPassword()))){
					    	//验证用户状态，是否有效用户
						   if (user.getStatus().equals("0")) {
							   logger.info("This user's [" + upToken.getUsername() + "] status is not enabled!");
							   throw new DisabledAccountException("This user's [" + upToken.getUsername() + "] status is not enabled"); 
						   }
				   }else{
					   throw new AuthenticationException();  
				   }
			}catch(Exception e){
				  e.printStackTrace();
			}
			SecurityUtils.getSubject().getSession().setAttribute("user", user);
			info = new SimpleAuthenticationInfo(user.getUserName(), user.getPassword(), getName());  
		    //return  new SimpleAuthenticationInfo(new ShiroUser(user.getUserName(), user.getRealName()),user.getPassword(), ByteSource.Util.bytes(EncodeUtils.hexDecode (user.getPassword())), getName());	
		    return info;
		}