|
|
@@ -25,6 +25,7 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.http.*; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.client.RestTemplate; |
|
|
|
|
|
|
|
/** |
|
|
@@ -76,6 +77,7 @@ public class IUserServiceImpl extends ServiceImpl<UserMapper, User> implements I |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public JsonResult resetPwd(ResetPwdDto dto) { |
|
|
|
//获取登录用户信息 |
|
|
|
String username = SecurityUserUtils.username(); |
|
|
@@ -89,7 +91,7 @@ public class IUserServiceImpl extends ServiceImpl<UserMapper, User> implements I |
|
|
|
} |
|
|
|
//密码校验 |
|
|
|
if (!user.getPassword().equals(CommonUtils.password(dto.getOldPassword()))) { |
|
|
|
return JsonResult.error(UserCodeEnum.OLD_PASSWORD_IS_NULL.getCode(),UserCodeEnum.OLD_PASSWORD_IS_NULL.getMsg()); |
|
|
|
return JsonResult.error(UserCodeEnum.OLD_PASSWORD_IS_ERROR.getCode(),UserCodeEnum.OLD_PASSWORD_IS_ERROR.getMsg()); |
|
|
|
} |
|
|
|
//设置新密码 |
|
|
|
user.setPassword(CommonUtils.password(dto.getNewPassword())); |