diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java index 05a78771..57fd9beb 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcAppUserController.java @@ -108,7 +108,7 @@ public class XhpcAppUserController extends BaseController { /** * C端用户注册 */ - @Log(title = "C端用户--注册", businessType = BusinessType.INSERT) + //@Log(title = "C端用户--注册", businessType = BusinessType.INSERT) @ApiOperation("注册") @PostMapping("/register") public R register(@RequestBody Map map) { diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java index c2ed2668..e967ba4b 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java @@ -149,8 +149,11 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU return R.fail(HttpStatus.NOT_NULL, "验证码不能为空"); } String captcha = redisService.getCacheObject("pvToken:" + phone); + if(captcha==null || "".equals(captcha)){ + return R.fail(HttpStatus.ERROR_STATUS, "验证码错误"); + } if (!code.equalsIgnoreCase(captcha)) { - R.fail(HttpStatus.ERROR_STATUS, "验证码错误"); + return R.fail(HttpStatus.ERROR_STATUS, "验证码错误"); } XhpcAppUser info = xhpcAppUserMapper.getAppUserByPhone(phone,tenantId); if (StringUtils.isNotNull(info)) { @@ -209,11 +212,15 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU String openid = StringUtils.valueOf(map.get("openid")); logger.info("<<<<<<<<<>>>>>>>>>>>"); logger.info("<<<<<<<<<<登录openid>>>>>>>>>>>>"+openid); + logger.info("<<<<<<<<<>>>>>>>>>>>"); if (StringUtils.isEmpty(openid)) { return R.fail(HttpStatus.NOT_NULL, "openid不能为空"); } String captcha = redisService.getCacheObject("pvToken:" + phone); + if(null ==captcha || "".equals(captcha)){ + return R.fail(HttpStatus.ERROR_STATUS, "验证码错误"); + } if (!code.equalsIgnoreCase(captcha)) { return R.fail(HttpStatus.ERROR_STATUS, "验证码错误"); } @@ -530,6 +537,9 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU return R.fail(HttpStatus.NOT_NULL, "手机号不能为空"); } String captcha = redisService.getCacheObject("pvToken:" + phone); + if(null ==captcha || "".equals(captcha)){ + return R.fail(HttpStatus.ERROR_STATUS, "验证码错误"); + } if (!code.equalsIgnoreCase(captcha)) { return R.fail(HttpStatus.ERROR_STATUS, "验证码错误"); }