failed:Read timed out 调用微信报错超时?
报错信息:
调用代码:
private static WxMpService wxMpService;
static {
WxMpInMemoryConfigStorage config = new WxMpInMemoryConfigStorage();
config.setAppId("xxxxxx"); // 设置微信公众号的appid
config.setSecret("xxxxxxxxxxxxxxxx"); // 设置微信公众号的app corpSecret
wxMpService = new WxMpServiceImpl();// 实际项目中请注意要保持单例,不要在每次请求时构造实例,具体可以参考demo项目
wxMpService.setWxMpConfigStorage(config);
}
[@RequestMapping](/user/RequestMapping)(value = "/createJsapiSignature")
[@ResponseBody](/user/ResponseBody)
public Map<String,Object> createJsapiSignature(String url) throws WxErrorException {
Map<String,Object> result=new HashMap<>();
try {
result.put("result", true);
result.put("data", wxMpService.createJsapiSignature(url));
}catch (Exception ex){
result.put("result", false);
result.put("msg",ex.getMessage());
}
return result;
}