wei.zhang2 2017-10-16 10:35:54 +08:00
parent 96aab84b83
commit 53dbc34091
1 changed files with 2 additions and 2 deletions

View File

@ -70,8 +70,8 @@ public class UserServiceImpl implements UserService {
throw new IllegalArgumentException("用户不存在");
}
if (passwordEncoder.matches(oldPassword, u.getPassword())) {
throw new IllegalArgumentException("密码错误");
if (!passwordEncoder.matches(oldPassword, u.getPassword())) {
throw new IllegalArgumentException("密码错误");
}
userDao.changePassword(u.getId(), passwordEncoder.encode(newPassword));