From cd8d40bd1371a2a92f7e02778447a231967cf483 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 20 Sep 2022 18:37:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=97=A5=E5=BF=974=20-=20match22222?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/ThirdLoginServiceImpl.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 9da4f885d5..28ed676b14 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -607,11 +607,14 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol @Override public List getMyOrgByAccount(ThirdStaffOrgByAccountFormDTO formDTO) { - //{"isNovice":false,"mobile":"","userAccount":"18700011111","password":"Py011111","appId":"wx2b75d556ba867750"} - String appId = formDTO.getAppId(); String userAccount = formDTO.getUserAccount(); String password = formDTO.getPassword(); + if ("wx2b75d556ba867750".equals(appId)){ + redisUtils.get("epmet:gov:py:staff:userAccount"); + } + //{"isNovice":false,"mobile":"","userAccount":"18700011111","password":"Py011111","appId":"wx2b75d556ba867750"} + logger.info("getMyOrgByAccountService at :{}",System.currentTimeMillis()); long start = System.currentTimeMillis(); //0.根据appId查询对应客户Id @@ -649,14 +652,11 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol continue; } long start2 = System.currentTimeMillis(); - if (!PasswordUtils.matches(formDTO.getPassword(), customerStaffDTO.getPassword())) { - logger.warn(String.format("当前用户:账户%s,客户Id%s密码匹配错误.",formDTO.getUserAccount(),customerStaffDTO.getCustomerId())); - logger.info("getMyOrgByAccountService PasswordUtils.matches cost:{}",System.currentTimeMillis()-start2); - }else{ - logger.warn(String.format("当前用户:账户%s,客户Id%s密码匹配正确.",formDTO.getUserAccount(),customerStaffDTO.getCustomerId())); + if (PasswordUtils.matches(formDTO.getPassword(), customerStaffDTO.getPassword())) { passwordRightFlag=true; customerIdList.add(customerStaffDTO.getCustomerId()); } + logger.info("getMyOrgByAccountService PasswordUtils.matches cost:{}",System.currentTimeMillis()-start2); } //根据手机号查出来所有用户,密码都为空,表明用户未激活账户,未设置密码 if(!havePasswordFlag){ From 2188e14a4a102798b9c02c9d95a0c636c497ed24 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 20 Sep 2022 18:39:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=97=A5=E5=BF=974=20-=20match222221231231?= =?UTF-8?q?23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ThirdLoginServiceImpl.java | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 28ed676b14..3881f9cae0 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -644,20 +644,18 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol boolean havePasswordFlag=false; //密码是否正确 boolean passwordRightFlag=false; - for (CustomerStaffDTO customerStaffDTO : customerStaffList) { - if(StringUtils.isNotBlank(customerStaffDTO.getPassword())){ - havePasswordFlag=true; - }else{ - logger.warn(String.format("当前用户:账户%s,客户Id%s下未设置密码.",formDTO.getUserAccount(),customerStaffDTO.getCustomerId())); - continue; - } - long start2 = System.currentTimeMillis(); - if (PasswordUtils.matches(formDTO.getPassword(), customerStaffDTO.getPassword())) { - passwordRightFlag=true; - customerIdList.add(customerStaffDTO.getCustomerId()); - } - logger.info("getMyOrgByAccountService PasswordUtils.matches cost:{}",System.currentTimeMillis()-start2); + CustomerStaffDTO customerStaffDTO = customerStaffList.get(0); + + if (StringUtils.isNotBlank(customerStaffDTO.getPassword())) { + havePasswordFlag = true; } + long start2 = System.currentTimeMillis(); + if (PasswordUtils.matches(formDTO.getPassword(), customerStaffDTO.getPassword())) { + passwordRightFlag = true; + customerIdList.add(customerStaffDTO.getCustomerId()); + } + logger.info("getMyOrgByAccountService PasswordUtils.matches cost:{}", System.currentTimeMillis() - start2); + //根据手机号查出来所有用户,密码都为空,表明用户未激活账户,未设置密码 if(!havePasswordFlag){ logger.warn(String.format("当前账户(%s)下所有账户都未设置密码,请先使用验证码登录激活账户",formDTO.getUserAccount())); @@ -670,7 +668,6 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol } logger.info("getMyOrgByAccountService checkpassword cost:{}",System.currentTimeMillis() - start); start = System.currentTimeMillis(); - CustomerStaffDTO customerStaffDTO = customerStaffList.get(0); String tempKey = RedisKeys.getCustomerStaffTempKey(customerStaffDTO.getUserId()); List redisTemp = (List)redisUtils.get(tempKey); if (redisTemp != null){