判断手机号是否存在,如果存在抛出异常
This commit is contained in:
@@ -167,9 +167,13 @@ public class MemberBuyerController {
|
||||
@RequestHeader String uuid) {
|
||||
if (smsUtil.verifyCode(mobile, VerificationEnums.BIND_MOBILE, uuid, code)) {
|
||||
Member member = memberService.findByUsername(username);
|
||||
Member memberByMobile = memberService.findByMobile(mobile);
|
||||
if (member == null) {
|
||||
throw new ServiceException(ResultCode.USER_NOT_EXIST);
|
||||
}
|
||||
if(memberByMobile != null){
|
||||
throw new ServiceException(ResultCode.USER_MOBILE_REPEATABLE_ERROR);
|
||||
}
|
||||
return ResultUtil.data(memberService.changeMobile(member.getId(), mobile));
|
||||
} else {
|
||||
throw new ServiceException(ResultCode.VERIFICATION_SMS_CHECKED_ERROR);
|
||||
|
||||
Reference in New Issue
Block a user