Commit 439087c8 by 吴迪

修改手机号

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