1、微信公众号绑定分享的域名

2、加上ip白名单

3、有一个MP_verify_EM2V8QaIKnqw5Ts2.txt 将该文件放在机器下

4、编写获取微信分享的接口

public String get(String url) {
BufferedReader in = null;
try {
//微信的httpUrl:http://XXX/x-thirdparty-web/weixinJssdk/config?signatureUrl=
        in = new BufferedReader(new InputStreamReader(HttpClientUtils.get(config.getWeixinHttpUrl() + url + "&thirdpartyId=XXX")));
StringBuffer sb = new StringBuffer();
String line;
while ((line = in.readLine()) != null) {
sb.append(line);
}
return sb.toString();
} catch (Exception e) {
logger.error("Exception occur when send http get request!", e);
}
// 使用finally块来关闭输入流
finally {
try {
if (in != null) {
in.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
return null;
}

参考链接:https://blog.csdn.net/u013142781/article/details/50429704

相关文章:

  • 2021-11-02
  • 2021-11-02
  • 2021-07-02
  • 2021-11-19
  • 2021-08-13
  • 2021-10-25
  • 2021-11-02
  • 2021-11-02
猜你喜欢
  • 2021-09-27
  • 2021-11-02
  • 2018-04-24
  • 2021-11-02
  • 2021-11-22
  • 2021-12-12
  • 2021-10-27
相关资源
相似解决方案