| | |
| | | |
| | | //发送验证码短信 |
| | | redisUtil.setStrValue(phone, authCode, 5 * 60);//设置五分钟过期 |
| | | SMSUtil.send_huawei_sms("b793ae3d41a049059197bfe92cf8bc83", "+" + phone, "[\"" + authCode + "\"]"); |
| | | String templateId = ""; |
| | | switch (language){ |
| | | case 1: |
| | | templateId = "b793ae3d41a049059197bfe92cf8bc83"; |
| | | break; |
| | | case 2: |
| | | templateId = "058c7d11ce594d668841cceb49fb5c9a"; |
| | | break; |
| | | case 3: |
| | | templateId = "4edbe604da6546808ffda582085b3c83"; |
| | | break; |
| | | } |
| | | SMSUtil.send_huawei_sms(templateId, "+" + phone, "[\"" + authCode + "\"]"); |
| | | System.out.println(sms); |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | * @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"); |
| | | } |