weixin-java-cp-demo icon indicating copy to clipboard operation
weixin-java-cp-demo copied to clipboard

WxCpConfigStorage wxCpConfigStorage = this.wxCpService.getWxCpConfigStorage();

Open steadyliu opened this issue 4 years ago • 4 comments

这个获取就会是空的 ,不知为何

steadyliu avatar Dec 29 '20 12:12 steadyliu

设置了吗?是否修改过demo?

binarywang avatar Dec 30 '20 01:12 binarywang

private WxCpService wxCpService = new WxCpServiceImpl(); @Autowired private WxCpProperties wxCpProperties ; @RequestMapping("authorize") public void authorize(HttpServletRequest request, HttpServletResponse response) throws IOException, WxErrorException { WxCpDefaultConfigImpl config = new WxCpDefaultConfigImpl(); config.setCorpId(wxCpProperties.getCorpId()); config.setCorpSecret(wxCpProperties.getAppConfigs().get(0).getSecret()); config.setAgentId(wxCpProperties.getAppConfigs().get(0).getAgentId()); config.setToken(wxCpProperties.getAppConfigs().get(0).getToken()); config.setAesKey(wxCpProperties.getAppConfigs().get(0).getAesKey()); String redirectUri ="http://" +request.getServerName()+"/wx/cp/oauth2/getUserInfo"; 我通过这个来设置的。就行了 里面封装的太多了 如果有详细的教程就好了

steadyliu avatar Dec 30 '20 01:12 steadyliu

不要每次请求时去设置参数,你参考demo的做法就不会有问题

binarywang avatar Dec 30 '20 02:12 binarywang

demo我直接放到项目了 ,没有看到这块是怎么设置的

steadyliu avatar Dec 30 '20 08:12 steadyliu