Commit 5a416e44 by 吴迪

修改成手机查询个人信息

parent 4cbb8355
package io.office.modules.manage.service.impl; package io.office.modules.manage.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import io.office.common.exception.RRException; import io.office.common.exception.RRException;
import io.office.common.utils.IPUtils; import io.office.common.utils.IPUtils;
import io.office.modules.manage.dao.*; import io.office.modules.manage.dao.*;
...@@ -25,10 +26,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -25,10 +26,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.common.utils.Query; import io.office.common.utils.Query;
import io.office.modules.manage.service.MemberService; import io.office.modules.manage.service.MemberService;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
@Service("memberService") @Service("memberService")
...@@ -162,14 +161,20 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl ...@@ -162,14 +161,20 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
if (!newPass.equals(affirmPass)) { if (!newPass.equals(affirmPass)) {
throw new RRException("两次密码信息不一致,请重新输入"); throw new RRException("两次密码信息不一致,请重新输入");
} }
MemberEntity memberEntity = memberDao.selectById(id); //根据手机号修改
String passData = memberEntity.getPass(); UpdateWrapper<MemberEntity> memberEntityUpdateWrapper = new UpdateWrapper<MemberEntity>();
String passMD5 = MD5Util.md5Encrypt32Lower(oldPass); memberEntityUpdateWrapper.eq("phone",id);
if (!passMD5.equals(passData)) { MemberEntity memberEntity = memberDao.selectOne(memberEntityUpdateWrapper);
throw new RRException("旧密码输入错误"); if(memberEntity!=null) {
String passData = memberEntity.getPass();
String passMD5 = MD5Util.md5Encrypt32Lower(oldPass);
if (!passMD5.equals(passData)) {
throw new RRException("旧密码输入错误");
}
//修改密码
memberDao.updateByIdPassWord(Long.valueOf(id), MD5Util.md5Encrypt32Lower(newPass));
} }
//修改密码
memberDao.updateByIdPassWord(Long.valueOf(id), MD5Util.md5Encrypt32Lower(newPass));
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment