Skip to content

Commit

Permalink
修改bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shuaje committed Jun 4, 2018
1 parent 73593c9 commit f4d9683
Showing 1 changed file with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,6 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUser, SysUserMapper>
@Autowired
private SysAuthorizeService sysAuthorizeService;

@Override
@Transactional
public SysUser update(SysUser record) {
if (DataUtil.isEmpty(record.getPassword())) {
record.setPassword(null);
} else {
record.setPassword(SecurityUtil.encryptPassword(record.getPassword()));
}
if (DataUtil.isNotEmpty(record.getOldPassword())) {
SysUser sysUser = super.queryById(record.getId());
String encryptPassword = SecurityUtil.encryptPassword(record.getOldPassword());
if (!sysUser.getPassword().equals(encryptPassword)) {
throw new BusinessException("原密码错误.");
}
}
return super.update(record);
}

@Override
public SysUser queryById(Long id) {
SysUser record = super.queryById(id);
Expand Down

0 comments on commit f4d9683

Please sign in to comment.