From b4e31c13cc4ff85a5819cd14474ee51017dffd3b Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 22 Sep 2021 17:16:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HighUserCardController.java | 40 +++++++------------ 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java index 50c05130..35db9cc9 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java @@ -177,40 +177,30 @@ public class HighUserCardController { @ResponseBody @ApiOperation(value = "根据手机号获取汇联通工会卡列表") public ResponseData getHuiLianTongCardByPhone(@RequestParam(name = "phone", required = true) String phone, - @RequestParam(name = "smsCode", required = true) String smsCode, HttpServletRequest request) { try { // 用户 SessionObject sessionObject = userCenter.getSessionObject(request); HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); - // 获取手机号验证码 - String phoneSmsCode = (String) redisUtil.get(phone); - - // 验证码校验 - if (StringUtils.isNotBlank(phoneSmsCode) && Objects.equals(phoneSmsCode,smsCode)) { - // 验证码校验成功 - // 根据手机号查询卡号 - JSONObject jsonObject = HuiLianTongUnionCardConfig.queryCardByMobile(phone); - if(jsonObject.getString("respCode").equals("0000") && jsonObject.getString("respMessage").equals("ok")) { - JSONObject dataObject = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data")); - JSONArray cards = dataObject.getJSONArray("cards"); - for (Object cardObject : cards) { - JSONObject card = (JSONObject)cardObject; - if (highUserCardService.getDetailByUserCardNo(userInfoModel.getHighUser().getId(), card.getString("cardNo")) != null) { - card.put("bindStatus", true); - } else { - card.put("bindStatus", false); - } + // 验证码校验成功 + // 根据手机号查询卡号 + JSONObject jsonObject = HuiLianTongUnionCardConfig.queryCardByMobile(phone); + if(jsonObject.getString("respCode").equals("0000") && jsonObject.getString("respMessage").equals("ok")) { + JSONObject dataObject = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data")); + JSONArray cards = dataObject.getJSONArray("cards"); + for (Object cardObject : cards) { + JSONObject card = (JSONObject)cardObject; + if (highUserCardService.getDetailByUserCardNo(userInfoModel.getHighUser().getId(), card.getString("cardNo")) != null) { + card.put("bindStatus", true); + } else { + card.put("bindStatus", false); } - redisUtil.del(phone); - return ResponseMsgUtil.success(cards); - } else { - System.out.println(jsonObject); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败"); } + return ResponseMsgUtil.success(cards); } - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "验证码错误"); + System.out.println(jsonObject); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败"); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardByPhone() error!", e); return ResponseMsgUtil.exception(e);