Browse Source

微信第三方平台-authInfo修改

master
zxc 5 years ago
parent
commit
bb4d6e3b2a
  1. 2
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/RemoveBindFormDTO.java
  2. 6
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java
  3. 6
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java

2
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/RemoveBindFormDTO.java

@ -23,4 +23,6 @@ public class RemoveBindFormDTO implements Serializable {
@NotBlank(message = "客户端类型不能为空",groups = {RemoveBindFormDTO.RemoveBind.class})
private String clientType;
private String customerId;
}

6
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java

@ -79,7 +79,7 @@ public class AppLetAuthorizationServiceImpl implements AppLetAuthorizationServic
*/
@Override
public void removeBind(TokenDto tokenDto, RemoveBindFormDTO formDTO) {
String customerId = componentVerifyTicketServiceImpl.getLoginUserCustomerId(tokenDto);
String customerId = formDTO.getCustomerId();
String clientType = formDTO.getClientType();
//查询openAppId
String openAppId = openPlatformAccountDao.selectOpenAppIdByCustomerId(customerId);
@ -91,8 +91,8 @@ public class AppLetAuthorizationServiceImpl implements AppLetAuthorizationServic
jsonObject.put(ModuleConstant.LOW_APP_ID,authAppId);
jsonObject.put(ModuleConstant.OPEN_APP_ID,openAppId);
String data = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.UN_BIND + authorizationInfo.getAuthorizer_access_token(), JSON.toJSONString(jsonObject)).getData();
Map<String,String> map = JSON.parseObject(data, Map.class);
if (!map.get(ModuleConstant.ERR_CODE).equals(NumConstant.ZERO_STR)){
Map<String,Object> map = JSON.parseObject(data, Map.class);
if (!map.get(ModuleConstant.ERR_CODE).equals(NumConstant.ZERO)){
log.error("解绑失败" + data);
throw new RenException("解绑失败" + data);
}

6
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java

@ -355,6 +355,12 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
authorizationInfoDao.insertAuthorizerAccessToken(formDTO);
//缓存 refreshAuthorizerAccessToken
redisThird.setAuthorizerRefreshToken(authorizationInfo);
AuthorizationInfoResultDTO resultDTO = new AuthorizationInfoResultDTO();
resultDTO.setAuthorizer_access_token(authorizerAccessToken);
resultDTO.setAuthorizer_refresh_token(authorizerRefreshToken);
resultDTO.setAuthorizer_appid(authAppId);
resultDTO.setExpires_in(7200);
redisThird.setAuthInfo(resultDTO,customerId,clientType);
}
});
log.info("更新authorizer_access_token成功");

Loading…
Cancel
Save