|
|
@@ -48,26 +48,25 @@ public class AppletUserServiceImpl implements IAppletUserService {
|
|
|
vo.setAvatar(ossService.getById(user.getAvatar()).getUrl());
|
|
|
}
|
|
|
vo.setGender(user.getSex());
|
|
|
-
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int updatePassword(AppletUserUpdatePasswordBo bo) {
|
|
|
+ public boolean updatePassword(AppletUserUpdatePasswordBo bo) {
|
|
|
SysUser user = userMapper.selectById(LoginHelper.getUserId());
|
|
|
if (!BCrypt.checkpw(bo.getOldPassword(), user.getPassword())) {
|
|
|
throw new BusinessException(MessageUtils.message("applet.auth.login.passworderror"));
|
|
|
}
|
|
|
user.setPassword(BCrypt.hashpw(bo.getNewPassword()));
|
|
|
- return userMapper.updateById(user);
|
|
|
+ return userMapper.updateById(user) > 0;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int updateAvatar(AppletUserUpdateAvatarBo bo) {
|
|
|
+ public boolean updateAvatar(AppletUserUpdateAvatarBo bo) {
|
|
|
return userMapper.update(
|
|
|
Wrappers.lambdaUpdate(SysUser.class)
|
|
|
.eq(SysUser::getUserId, LoginHelper.getUserId())
|
|
|
.set(bo.getId() != null, SysUser::getAvatar, bo.getId())
|
|
|
- );
|
|
|
+ ) > 0;
|
|
|
}
|
|
|
}
|