关于微信公众号的开发

url自定义,令牌token自定义

公众号支付,设置支付目录,设置回调在支付权限中

/*

* 进行接口验证

*/

String signature = request.getParameter("signature");

String timestamp = request.getParameter("timestamp");

String nonce = request.getParameter("nonce");

String echostr = request.getParameter("echostr");

System.out.println(signature);

System.out.println(timestamp);

System.out.println(nonce);

System.out.println(echostr);

if (null != timestamp && null != nonce && null != echostr && null != signature) {

if (WeiXinTools.access(TOKEN, signature, timestamp, nonce)) {

GotoWeiXinConnect gotoWeixinConnect = new GotoWeiXinConnect();

gotoWeixinConnect.setCreateTime(TimeUtil.getCurrentTimeDate());

gotoWeixinConnect.setModifyTime(TimeUtil.getCurrentTimeDate());

gotoWeixinConnect.setSignature(signature);

gotoWeixinConnect.setTimestamp(timestamp);

gotoWeixinConnect.setNonce(nonce);

gotoWeixinConnect.setEchostr(echostr);

gotoWeixinConnect.setGuid(MD5.getGuid());

gotoWeiXinConnectService.insertSelective(gotoWeixinConnect);

response.getWriter().write(echostr);

return;

}

return;

} else {

return;

}


只要返回echostr就可以了

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容