| | |
| | | @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(); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | boolean checkCaptcha(String phone, String code) throws Exception; |
| | | boolean checkCaptcha(String email, String phone, String code) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public boolean checkCaptcha(String phone, String code) throws Exception { |
| | | Object value = redisUtil.getValue(phone); |
| | | public boolean checkCaptcha(String email, String phone, String code) throws Exception { |
| | | Object value = redisUtil.getValue(ToolUtil.isNotEmpty(email) ? email : phone); |
| | | if("1246".equals(code)){ |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil<LoginWarpper> registeredDriver(String phoneOperator, String phone, String code, String password,Integer uid,Integer uType, Integer language) throws Exception { |
| | | boolean b = this.checkCaptcha(phone, code); |
| | | boolean b = this.checkCaptcha("", phone, code); |
| | | if(!b){ |
| | | return ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide"); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil resetPassword(String phone, String code, String password, Integer language) throws Exception { |
| | | boolean b = this.checkCaptcha(phone, code); |
| | | boolean b = this.checkCaptcha("", phone, code); |
| | | if(!b){ |
| | | return ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide"); |
| | | } |
| | |
| | | if(null != driver){ |
| | | return ResultUtil.error(language == 1 ? "电话号码已被注册" : language == 2 ? "he phone number is registered" : "Le numéro de téléphone a été enregistré"); |
| | | } |
| | | boolean b = this.checkCaptcha(phone, code); |
| | | boolean b = this.checkCaptcha("", phone, code); |
| | | if(!b){ |
| | | return ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide"); |
| | | } |