解决admin项目无法启动问题。
完善验证码模块优化需要优化的项目
This commit is contained in:
@@ -47,11 +47,8 @@ public class MemberBuyerController {
|
||||
public ResultMessage<Object> userLogin(@NotNull(message = "用户名不能为空") @RequestParam String username,
|
||||
@NotNull(message = "密码不能为空") @RequestParam String password,
|
||||
@RequestHeader String uuid) {
|
||||
if (verificationService.check(uuid, VerificationEnums.LOGIN)) {
|
||||
return ResultUtil.data(this.memberService.usernameLogin(username, password));
|
||||
} else {
|
||||
throw new ServiceException(ResultCode.VERIFICATION_ERROR);
|
||||
}
|
||||
verificationService.check(uuid, VerificationEnums.LOGIN);
|
||||
return ResultUtil.data(this.memberService.usernameLogin(username, password));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "短信登录接口")
|
||||
@@ -63,11 +60,8 @@ public class MemberBuyerController {
|
||||
public ResultMessage<Object> smsLogin(@NotNull(message = "手机号为空") @RequestParam String mobile,
|
||||
@NotNull(message = "验证码为空") @RequestParam String code,
|
||||
@RequestHeader String uuid) {
|
||||
if (smsUtil.verifyCode(mobile, VerificationEnums.LOGIN, uuid, code)) {
|
||||
return ResultUtil.data(memberService.mobilePhoneLogin(mobile));
|
||||
} else {
|
||||
throw new ServiceException(ResultCode.VERIFICATION_SMS_ERROR);
|
||||
}
|
||||
smsUtil.verifyCode(mobile, VerificationEnums.LOGIN, uuid, code);
|
||||
return ResultUtil.data(memberService.mobilePhoneLogin(mobile));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "注册用户")
|
||||
@@ -84,12 +78,9 @@ public class MemberBuyerController {
|
||||
@RequestHeader String uuid,
|
||||
@NotNull(message = "验证码不能为空") @RequestParam String code) {
|
||||
|
||||
boolean result = smsUtil.verifyCode(mobilePhone, VerificationEnums.REGISTER, uuid, code);
|
||||
if (result) {
|
||||
return ResultUtil.data(memberService.register(username, password, mobilePhone));
|
||||
} else {
|
||||
throw new ServiceException(ResultCode.VERIFICATION_SMS_ERROR);
|
||||
}
|
||||
smsUtil.verifyCode(mobilePhone, VerificationEnums.REGISTER, uuid, code);
|
||||
return ResultUtil.data(memberService.register(username, password, mobilePhone));
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取当前登录用户接口")
|
||||
@@ -109,13 +100,11 @@ public class MemberBuyerController {
|
||||
@NotNull(message = "验证码为空") @RequestParam String code,
|
||||
@RequestHeader String uuid) {
|
||||
//校验短信验证码是否正确
|
||||
if (smsUtil.verifyCode(mobile, VerificationEnums.FIND_USER, uuid, code)) {
|
||||
//校验是否通过手机号可获取会员,存在则将会员信息存入缓存,有效时间3分钟
|
||||
if (memberService.findByMobile(uuid, mobile)) {
|
||||
return ResultUtil.success();
|
||||
}
|
||||
}
|
||||
throw new ServiceException(ResultCode.VERIFICATION_ERROR);
|
||||
smsUtil.verifyCode(mobile, VerificationEnums.FIND_USER, uuid, code);
|
||||
//校验是否通过手机号可获取会员,存在则将会员信息存入缓存,有效时间3分钟
|
||||
memberService.findByMobile(uuid, mobile);
|
||||
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改密码")
|
||||
|
||||
Reference in New Issue
Block a user