| | |
| | | String code = redisUtil.getValue(phone+"_Code"); |
| | | System.out.println("缓存中验证码为:"+code); |
| | | if (ToolUtil.isEmpty(kaptcha) || !kaptcha.equalsIgnoreCase(code)) { |
| | | return ResultUtil.error(language == 1 ? "图形验证码错误" : language == 2 ? "The graphic verification code is incorrect" : "Code de vérification graphique incorrect"); |
| | | return ResultUtil.error(language == 1 ? "图形验证码错误" : language == 2 ? "Wrong CAPTCHA" : "CAPTCHA erroné"); |
| | | } |
| | | return userInfoService.queryCaptcha(phone, type, language); |
| | | }catch (Exception e){ |
| | |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | |
| | | if(ToolUtil.isEmpty(email)){ |
| | | return ResultUtil.error(language == 1 ? "邮箱不能为空" : language == 2 ? "The mailbox cannot be empty" : "L’email ne peut pas être vide"); |
| | | return ResultUtil.error(language == 1 ? "邮箱不能为空" : language == 2 ? "E-mail address cannot be empty." : "L’adresse e-mail ne peut pas être vide."); |
| | | } |
| | | |
| | | Random random = new Random(); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "微信jscode(小程序登录上传)", name = "jscode", required = false, dataType = "String") |
| | | }) |
| | | public ResultUtil<LoginWarpper> wxIsLogin( String jscode){ |
| | | public ResultUtil<LoginWarpper> wxIsLogin(Integer language, String jscode){ |
| | | try { |
| | | return userInfoService.wxIsLogin(jscode); |
| | | return userInfoService.wxIsLogin(language, jscode); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<UserInfoWarpper> queryUserInfo(HttpServletRequest request){ |
| | | public ResultUtil<UserInfoWarpper> queryUserInfo(Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Map<String, Object> map = userInfoService.queryUserInfo(uid); |
| | | Map<String, Object> map = userInfoService.queryUserInfo(language, uid); |
| | | return ResultUtil.success(UserInfoWarpper.getUserInfoWarpper(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "电话号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<Object> queryUser(String phone){ |
| | | public ResultUtil<Object> queryUser(Integer language, String phone){ |
| | | try { |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | Map<String, Object> map = userInfoService.queryUser(phone); |
| | | Map<String, Object> map = userInfoService.queryUser(language, phone); |
| | | if(null != map){ |
| | | return ResultUtil.success(UserInfoWarpper.getUserInfoWarpper(map)); |
| | | } |
| | |
| | | BigDecimal bigDecimal = new BigDecimal(code); |
| | | long max = Long.MAX_VALUE; |
| | | if(bigDecimal.compareTo(new BigDecimal(max)) >= 0){ |
| | | return ResultUtil.error(language == 1 ? "银行卡号格式错误" : language == 2 ? "The format of bank card number is incorrect" : "Format incorrect du numéro de carte bancaire"); |
| | | return ResultUtil.error(language == 1 ? "银行卡号格式错误" : language == 2 ? "Format error of bank card" : "Erreur de format de la carte bancaire"); |
| | | } |
| | | BankCard bankCard = bankCardService.selectOne(new EntityWrapper<BankCard>().eq("code", code)); |
| | | if(null != bankCard){ |
| | | return ResultUtil.error(language == 1 ? "银行卡重复" : language == 2 ? "Duplicate bank card" : "Double carte bancaire"); |
| | | return ResultUtil.error(language == 1 ? "银行卡重复" : language == 2 ? "Reduplication of bank card" : "Reduplication de la carte bancaire"); |
| | | } |
| | | bankCard = new BankCard(); |
| | | bankCard.setUserId(uid); |