获取微信分享签名
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