From a46583f3ba4e14851d4432454c5eb9c5e25806bc Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Thu, 23 Jul 2020 18:53:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0-=E6=8E=88=E6=9D=83=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ComponentVerifyTicketServiceImpl.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java index 6751cd4ac0..6fbac46cd3 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java @@ -140,13 +140,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe String authCode = result.get(ModuleConstant.AUTHORIZATION_CODE_HUMP); String authAppId = result.get(ModuleConstant.AUTHORIZER_APP_ID_HUMP); log.info("=============================="+authCode); - AuthCodeResultDTO authCodeResultDTO = authorizationInfoDao.selectCustomerIdByAuthAppId(authAppId); - String clientType = authCodeResultDTO.getClientType(); - String customerId = authCodeResultDTO.getCustomerId(); - this.createAndBindOpenAccount(customerId,authAppId,clientType); - this.updateCustomerMpAppId(customerId,authAppId,clientType); - authCodeDao.updateAppId(customerId,clientType,authAppId); - this.saveAuthAccountInfo(customerId,authAppId,clientType); + break; case ModuleConstant.UNAUTHORIZED://用户取消授权 //todo 取消授权 @@ -373,26 +367,32 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe public void redirectUri(TokenDto tokenDto, @RequestBody AuthCodeAndTimeFromDTO authCodeAndTime){ log.info("开始执行回调URL"); String authCode = authCodeAndTime.getAuthCode(); - String client = authCodeAndTime.getClientType(); + String clientType = authCodeAndTime.getClientType(); String expiresIn = authCodeAndTime.getExpiresIn(); String customerId = this.getLoginUserCustomerId(tokenDto); Date expiresInTime = this.countExpirationTime(expiresIn); - if (StringUtils.isBlank(customerId)||StringUtils.isBlank(client)||StringUtils.isBlank(authCode)||StringUtils.isBlank(expiresIn)){ - log.info("客户ID = "+customerId+", 客户端类型为 = "+client+", 授权码为 = "+authCode+", 有效期 = "+expiresIn); + if (StringUtils.isBlank(customerId)||StringUtils.isBlank(clientType)||StringUtils.isBlank(authCode)||StringUtils.isBlank(expiresIn)){ + log.info("客户ID = "+customerId+", 客户端类型为 = "+clientType+", 授权码为 = "+authCode+", 有效期 = "+expiresIn); } //authCode存数据库 AuthCodeFormDTO formDTO = new AuthCodeFormDTO(); formDTO.setAuthCode(authCode); formDTO.setExpiresInTime(expiresInTime); - formDTO.setClientType(client); + formDTO.setClientType(clientType); //授权方AppId formDTO.setCustomerId(customerId); log.info(formDTO.toString()); - authCodeDao.deleteCustomerAuthCode(customerId,client); + authCodeDao.deleteCustomerAuthCode(customerId,clientType); authCodeDao.insertRedirectAuthCode(formDTO); //authCode存缓存 redisThird.setAuthCode(formDTO); - this.authInfoByAuthCode(authCode, customerId,client); + AuthorizationInfoResultDTO authorizationInfoResultDTO = this.authInfoByAuthCode(authCode, customerId, clientType); + String authAppId = authorizationInfoResultDTO.getAuthorizer_appid(); + AuthCodeResultDTO authCodeResultDTO = authorizationInfoDao.selectCustomerIdByAuthAppId(authAppId); + this.createAndBindOpenAccount(customerId,authAppId,clientType); + this.updateCustomerMpAppId(customerId,authAppId,clientType); + authCodeDao.updateAppId(customerId,clientType,authAppId); + this.saveAuthAccountInfo(customerId,authAppId,clientType); log.info("回调结束"); }