public User login(String username, String pwd) { User user = userdao.getEntityByUniqueColumn(User.class, "loginName", username); if (pwd.equals(user.getPassword()) || EncryptUtil.md5Encode(pwd).equals(user.getPassword())) { logger.info("登录成功:" + username); return user; } return null; }
public boolean changePwd(User user, String pwd) { user.setPassword(EncryptUtil.md5Encode(pwd)); userdao.saveOrUpdate(user); return true; }