短信验证码验证结果未生效问题处理
This commit is contained in:
parent
31c2f555fc
commit
fa443a091f
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,6 +10,7 @@ target
|
|||||||
.factorypath
|
.factorypath
|
||||||
|
|
||||||
log/
|
log/
|
||||||
|
logs/
|
||||||
*.factorypath
|
*.factorypath
|
||||||
lili-shop/src/main/java/cn/lili/generator/CodeGenerator.java
|
lili-shop/src/main/java/cn/lili/generator/CodeGenerator.java
|
||||||
lili-logs
|
lili-logs
|
||||||
|
@ -13,6 +13,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
|||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@ -52,7 +53,7 @@ public class DistributionCashBuyerController {
|
|||||||
@ApiImplicitParam(name = "price", value = "申请金额", required = true, paramType = "query", dataType = "double")
|
@ApiImplicitParam(name = "price", value = "申请金额", required = true, paramType = "query", dataType = "double")
|
||||||
})
|
})
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ResultMessage<Object> cash(@Max(value = 1000, message = "提现金额单次最多允许提现1000元")
|
public ResultMessage<Object> cash(@Validated @Max(value = 9999, message = "提现金额单次最多允许提现9999元")
|
||||||
@Min(value = 1, message = "提现金额单次最少提现金额为1元")
|
@Min(value = 1, message = "提现金额单次最少提现金额为1元")
|
||||||
@NotNull @ApiIgnore Double price) {
|
@NotNull @ApiIgnore Double price) {
|
||||||
if (distributionCashService.cash(price)) {
|
if (distributionCashService.cash(price)) {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package cn.lili.controller.passport;
|
package cn.lili.controller.passport;
|
||||||
|
|
||||||
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.common.security.enums.UserEnums;
|
import cn.lili.common.security.enums.UserEnums;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.member.entity.dos.Member;
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
@ -66,8 +68,11 @@ public class MemberBuyerController {
|
|||||||
public ResultMessage<Object> smsLogin(@NotNull(message = "手机号为空") @RequestParam String mobile,
|
public ResultMessage<Object> smsLogin(@NotNull(message = "手机号为空") @RequestParam String mobile,
|
||||||
@NotNull(message = "验证码为空") @RequestParam String code,
|
@NotNull(message = "验证码为空") @RequestParam String code,
|
||||||
@RequestHeader String uuid) {
|
@RequestHeader String uuid) {
|
||||||
smsUtil.verifyCode(mobile, VerificationEnums.LOGIN, uuid, code);
|
if (smsUtil.verifyCode(mobile, VerificationEnums.LOGIN, uuid, code)) {
|
||||||
return ResultUtil.data(memberService.mobilePhoneLogin(mobile));
|
return ResultUtil.data(memberService.mobilePhoneLogin(mobile));
|
||||||
|
} else {
|
||||||
|
throw new ServiceException(ResultCode.VERIFICATION_SMS_CHECKED_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "注册用户")
|
@ApiOperation(value = "注册用户")
|
||||||
@ -84,8 +89,11 @@ public class MemberBuyerController {
|
|||||||
@RequestHeader String uuid,
|
@RequestHeader String uuid,
|
||||||
@NotNull(message = "验证码不能为空") @RequestParam String code) {
|
@NotNull(message = "验证码不能为空") @RequestParam String code) {
|
||||||
|
|
||||||
smsUtil.verifyCode(mobilePhone, VerificationEnums.REGISTER, uuid, code);
|
if (smsUtil.verifyCode(mobilePhone, VerificationEnums.REGISTER, uuid, code)) {
|
||||||
return ResultUtil.data(memberService.register(username, password, mobilePhone));
|
return ResultUtil.data(memberService.register(username, password, mobilePhone));
|
||||||
|
} else {
|
||||||
|
throw new ServiceException(ResultCode.VERIFICATION_SMS_CHECKED_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,11 +114,13 @@ public class MemberBuyerController {
|
|||||||
@NotNull(message = "验证码为空") @RequestParam String code,
|
@NotNull(message = "验证码为空") @RequestParam String code,
|
||||||
@RequestHeader String uuid) {
|
@RequestHeader String uuid) {
|
||||||
//校验短信验证码是否正确
|
//校验短信验证码是否正确
|
||||||
smsUtil.verifyCode(mobile, VerificationEnums.FIND_USER, uuid, code);
|
if (smsUtil.verifyCode(mobile, VerificationEnums.FIND_USER, uuid, code)) {
|
||||||
//校验是否通过手机号可获取会员,存在则将会员信息存入缓存,有效时间3分钟
|
//校验是否通过手机号可获取会员,存在则将会员信息存入缓存,有效时间3分钟
|
||||||
memberService.findByMobile(uuid, mobile);
|
memberService.findByMobile(uuid, mobile);
|
||||||
|
return ResultUtil.success();
|
||||||
return ResultUtil.success();
|
} else {
|
||||||
|
throw new ServiceException(ResultCode.VERIFICATION_SMS_CHECKED_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改密码")
|
@ApiOperation(value = "修改密码")
|
||||||
|
@ -125,7 +125,7 @@ public class MemberWalletBuyerController {
|
|||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "price", value = "提现金额", required = true, dataType = "double", paramType = "query")
|
@ApiImplicitParam(name = "price", value = "提现金额", required = true, dataType = "double", paramType = "query")
|
||||||
})
|
})
|
||||||
public ResultMessage<Boolean> withdrawal(@Max(value = 1000, message = "充值金额单次最多允许提现1000元") @Min(value = 1, message = "充值金额单次最少提现金额为1元") Double price) {
|
public ResultMessage<Boolean> withdrawal(@Max(value = 9999, message = "充值金额单次最多允许提现9999元") @Min(value = 1, message = "充值金额单次最少提现金额为1元") Double price) {
|
||||||
return ResultUtil.data(memberWalletService.applyWithdrawal(price));
|
return ResultUtil.data(memberWalletService.applyWithdrawal(price));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user