Repository navigation
多个企业微信号,获取存档消息解密失败 #2768
Copy link
Copy link
Closed
Description
Activity
是指多个cp分布式部署的,还是指多个企业corpid出现的问题?
同一个应用,多个企业corpid,单机的
多个企业corpid?WxCpConfiguration你是怎样配置的?我看下怎么根据corpId去调整获取会话存档
根据demo做的,这里的agentid是自己定义的
` public static WxCpService getCpService(Integer agentId) {
return cpServices.get(agentId);
}@PostConstruct public void initServices() { cpServices = this.properties.getAppConfigs().stream().map(a -> { val configStorage = new WxCpDefaultConfigImpl(); configStorage.setCorpId(a.getCorpId()); configStorage.setAgentId(a.getAgentId()); configStorage.setCorpSecret(a.getSecret()); configStorage.setToken(a.getToken()); configStorage.setAesKey(a.getAesKey()); String path = properties.getMsgAuditPriKeyPath() + "/" + a.getCorpId() + ".pem"; String priKey = FileUtil.readString(path, CharsetUtil.defaultCharset()); configStorage.setMsgAuditPriKey(priKey); configStorage.setMsgAuditLibPath(this.properties.getMsgAuditLibPath()); val service = new WxCpServiceImpl(); service.setWxCpConfigStorage(configStorage); routers.put(a.getAgentId(), this.newRouter(service)); return service; }).collect(Collectors.toMap(service -> service.getWxCpConfigStorage().getAgentId(), a -> a)); }`根据demo做的,这里的agentid是自己定义的 ` public static WxCpService getCpService(Integer agentId) { return cpServices.get(agentId); }
@PostConstruct public void initServices() { cpServices = this.properties.getAppConfigs().stream().map(a -> { val configStorage = new WxCpDefaultConfigImpl(); configStorage.setCorpId(a.getCorpId()); configStorage.setAgentId(a.getAgentId()); configStorage.setCorpSecret(a.getSecret()); configStorage.setToken(a.getToken()); configStorage.setAesKey(a.getAesKey()); String path = properties.getMsgAuditPriKeyPath() + "/" + a.getCorpId() + ".pem"; String priKey = FileUtil.readString(path, CharsetUtil.defaultCharset()); configStorage.setMsgAuditPriKey(priKey); configStorage.setMsgAuditLibPath(this.properties.getMsgAuditLibPath()); val service = new WxCpServiceImpl(); service.setWxCpConfigStorage(configStorage); routers.put(a.getAgentId(), this.newRouter(service)); return service; }).collect(Collectors.toMap(service -> service.getWxCpConfigStorage().getAgentId(), a -> a)); }`了解,我这边没有多个企业corpid,进一下钉钉交流2群:32206329,晚点调试下,晚点回复一下
好的,感谢大佬
好的,感谢大佬
等待回复
好的,感谢大佬
等待下个版本发布即可
Metadata
Metadata
Assignees
Labels
No labels
简要描述
请简单概括描述下你所遇到的问题。
多个企业微信,获取会话存档消息,解密报错
模块版本情况
详细描述
尽量详细描述。请不要使用截图,尽量使用文字描述,代码直接贴上来,日志则请附在后面所示区域。
多个企业微信,获取会话存档消息,第一个企业微信可以顺利解密数据,第二个及之后的主体解密报错,解密不了数据
日志
如果日志不多,直接使用md代码引用格式贴在此处,否则如果太长,请将日志放在 pastebin 或者其他地方,然后将其url地址贴在这里