1,错误描述
2,接口返回错误信息
{"base_resp":{"ret":200302,"err_msg":"verify token fail"}}
3,原因分析:
3.1,网上常见的demo都试了一遍;
4,处理方案:【把网上搜的方案,都进行测试,最后测试ok】
==测试不好使
@RequestMapping(value="/gzhNotice")
public void selectAlLNotice(HttpServletResponse response, HttpServletRequest request) throws Exception{
String token="xxx";
response.setContentType("text/plain;charset=UTF-8");
response.getWriter().write("success");
}
==测试不好使
@RequestMapping(value="/gzhNotice1")
public String selectAlLNotice1(HttpServletResponse response, HttpServletRequest request) throws Exception{
String token="xxx";
LogUtil.Info("返回微信的报文:"+state);
return "SUCCESS";
}
==测试不好使
@RequestMapping(value="/gzhNotice2")
public String selectAlLNotice2(HttpServletResponse response, HttpServletRequest request) throws Exception{
String token="xxx";
LogUtil.Info("返回微信的报文:"+state);
return "success";
}
==测试好使【20240516好使】
@RequestMapping(value="/gzhNotice3")
public String selectAlLNotice3(HttpServletResponse response, HttpServletRequest request) throws Exception{
String token="xxx";
LogUtil.Info("返回微信的报文:"+state);
String echostr = request.getParameter("echostr");
return echostr;
}