This commit is contained in:
geek 2017-08-24 18:25:33 +09:00
parent ac650575c1
commit 136ccb7a2d

View File

@ -73,12 +73,18 @@ public class MemberService {
Member preMember = this.memberDAO.findByEmail(member.getEmail());
member.setPw(passwordEncoder.encode(pw));
Boolean match = passwordEncoder.matches(member.getPw(), preMember.getPw());
if(match) {
throw new EqualsOldPasswordException();
if (null != pw && !pw.equals("")) {
Boolean match = passwordEncoder.matches(member.getPw(), preMember.getPw());
if(!match) {
member.setPw(passwordEncoder.encode(pw));
}
} else {
member.setPw(preMember.getPw());
}
if (member.getStatus() == null || member.getStatus().getId() < 0) {
member.getStatus().setId(preMember.getStatus().getId());
}
return this.memberDAO.save(member);
}