| | |
| | |
|
| | | import com.moral.common.exception.BusinessException;
|
| | | import com.moral.common.util.Crypto;
|
| | | import com.moral.common.util.ValidateUtil;
|
| | | import com.moral.entity.OperateUser;
|
| | | import com.moral.mapper.OperateUserMapper;
|
| | | import com.moral.service.OperateUserService;
|
| | |
| | |
|
| | | @Override
|
| | | public OperateUser mobileLogin(String mobile, String password) {
|
| | | ValidateUtil.notEmpty(mobile, "param.is.null");
|
| | | ValidateUtil.notEmpty(password, "param.is.null");
|
| | | OperateUser operateUser = new OperateUser();
|
| | | operateUser.setMobile(mobile);
|
| | | operateUser.setPassword(Crypto.md5(password));
|
| | |
| | | @Override
|
| | | @Transactional
|
| | | public OperateUser updatePassword(Integer uid, String password, String newPassword) {
|
| | | ValidateUtil.notNull(uid, "param.is.null");
|
| | | ValidateUtil.notEmpty(password, "param.is.null");
|
| | | ValidateUtil.notEmpty(newPassword, "param.is.null");
|
| | | OperateUser operateUser = operateUserMapper.selectByPrimaryKey(uid);
|
| | | if (ObjectUtils.isEmpty(operateUser) || !Crypto.md5(password).equals(operateUser.getPassword())) {
|
| | | throw new BusinessException("旧密码错误,修改密码失败!");
|