@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
if (log.isDebugEnabled()) log.debug("========> loadUserByUsername() username: {}", username);
AppUser user = userService.findByUserLoginName(username);
if (user == null)
throw new UsernameNotFoundException("用户(" + username + ")不存在");
if (log.isDebugEnabled()) {
log.debug("========> user: {}", user);
log.debug("========> password: {}", user.getUserPassword());
}
boolean accountNonExpired = true;
boolean credentialsNonExpired = true;
boolean accountNonLocked = true;
UserDetailsImpl userdetail = new UserDetailsImpl(
user.getUserLoginName(), user.getUserPassword(), user.getDisableFlag(), accountNonExpired, credentialsNonExpired,
accountNonLocked, obtainGrantedAuthorities(user), user);
return userdetail;
}