Commit 439087c8 by 吴迪

修改手机号

parent 3b74723c
...@@ -94,10 +94,10 @@ public class MemberController extends AbstractController { ...@@ -94,10 +94,10 @@ public class MemberController extends AbstractController {
// @RequiresPermissions("manage:member:info") // @RequiresPermissions("manage:member:info")
public R info(){ public R info(){
Long memberUserId = getMemberUserId(); Long memberUserId = getMemberUserId();
/*
QueryWrapper<MemberEntity> queryWrapper = new QueryWrapper<MemberEntity>(); QueryWrapper<MemberEntity> queryWrapper = new QueryWrapper<MemberEntity>();
queryWrapper.eq("phone",memberUserId); queryWrapper.eq("phone",memberUserId);*/
MemberEntity member = memberService.getOne(queryWrapper); MemberEntity member = memberService.getById(memberUserId);
return R.ok().put("data", member); return R.ok().put("data", member);
} }
......
...@@ -161,10 +161,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl ...@@ -161,10 +161,7 @@ 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);
UpdateWrapper<MemberEntity> memberEntityUpdateWrapper = new UpdateWrapper<MemberEntity>();
memberEntityUpdateWrapper.eq("phone",id);
MemberEntity memberEntity = memberDao.selectOne(memberEntityUpdateWrapper);
if(memberEntity!=null) { if(memberEntity!=null) {
String passData = memberEntity.getPass(); String passData = memberEntity.getPass();
String passMD5 = MD5Util.md5Encrypt32Lower(oldPass); String passMD5 = MD5Util.md5Encrypt32Lower(oldPass);
...@@ -351,13 +348,18 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl ...@@ -351,13 +348,18 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
* @return * @return
*/ */
private static boolean matchPhoneNumber(String phoneNumber) { private static boolean matchPhoneNumber(String phoneNumber) {
String regex = "1[358][0-9]{9}"; String regex = "1[3456789][0-9]{9}";
if (phoneNumber == null || phoneNumber.length() <= 0) { if (phoneNumber == null || phoneNumber.length() <= 0) {
return false; return false;
} }
return Pattern.matches(regex, phoneNumber); return Pattern.matches(regex, phoneNumber);
} }
public static void main(String[] args) {
System.out.println(matchPhoneNumber("17368588652"));
}
@Override @Override
public String getVerificationCode(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) { public String getVerificationCode(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) {
//验证码随机6位数字(验证码) //验证码随机6位数字(验证码)
......
...@@ -76,7 +76,7 @@ public class TimescodeRegiServiceImpl extends ServiceImpl<TimescodeRegiDao, Time ...@@ -76,7 +76,7 @@ public class TimescodeRegiServiceImpl extends ServiceImpl<TimescodeRegiDao, Time
* @return * @return
*/ */
private static boolean matchPhoneNumber(String phoneNumber) { private static boolean matchPhoneNumber(String phoneNumber) {
String regex = "1[358][0-9]{9}"; String regex = "1[3456789][0-9]{9}";
if(phoneNumber==null||phoneNumber.length()<=0){ if(phoneNumber==null||phoneNumber.length()<=0){
return false; return false;
} }
...@@ -84,14 +84,7 @@ public class TimescodeRegiServiceImpl extends ServiceImpl<TimescodeRegiDao, Time ...@@ -84,14 +84,7 @@ public class TimescodeRegiServiceImpl extends ServiceImpl<TimescodeRegiDao, Time
} }
public static void main(String[] args) { public static void main(String[] args) {
long l = System.currentTimeMillis(); System.out.println(matchPhoneNumber("17368588652"));
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
long l2 = System.currentTimeMillis();
System.out.println((l2-l)/1000+"秒");
} }
@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