微信公众号 验证token

来源:互联网 发布:vuze for mac 编辑:程序博客网 时间:2024/06/10 04:09
/**
* 测试
* @return
*/

@RequestMapping("test")
public String Test(HttpServletRequest request,HttpServletResponse response){
String signature = request.getParameter("signature");
String timestamp = request.getParameter("timestamp");
        String nonce = request.getParameter("nonce");
        String echostr = request.getParameter("echostr");
        System.out.println("signature:" + signature);
        System.out.println("timestamp:" + timestamp);
        System.out.println("nonce:" + nonce);
        System.out.println("echostr:" + echostr);
        PrintWriter pw;
try {
pw = response.getWriter();
pw.append(echostr);
pw.flush();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

return null;

}

//TOKEN值为: echostr

//URL  具体到方法

//EncodingAESKey 随机生成


原创粉丝点击