| | |
| | | @ApiOperation(value = "验证验证码", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "邮箱", name = "email", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "验证码", name = "code", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil checkCaptcha(String email, String code, Integer language){ |
| | | public ResultUtil checkCaptcha(String email, String phone, String code, Integer language){ |
| | | try { |
| | | boolean b = driverService.checkCaptcha(email, code); |
| | | if(ToolUtil.isNotEmpty(phone)){ |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | } |
| | | boolean b = driverService.checkCaptcha(email, phone, code); |
| | | return b ? ResultUtil.success() : ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |