Git Product home page Git Product logo

Comments (4)

niefy avatar niefy commented on August 20, 2024

暂未发现此问题,请详细描述问题出现场景、关键错误信息

from wx-api.

duanxiongfei avatar duanxiongfei commented on August 20, 2024

步骤:
1、从微信公众号中发送文本消息
2、接口监听调试

XssFilter.doFilter 代码中调试获取是正常的xml字符串数据,逻辑转到WxMpPortalController.post方法@RequestBody String requestBody接收到的内容总是一串数字“15963364665”此数字会变化
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper(
(HttpServletRequest) request);
chain.doFilter(xssRequest, response);
}

我临时方案是去掉入参@RequestBody String requestBody,增加参数XssHttpServletRequestWrapper requestWrapper
public String post(@PathVariable String appid,
// @RequestBody String requestBody,
@RequestParam("signature") String signature,
@RequestParam("timestamp") String timestamp,
@RequestParam("nonce") String nonce,
@RequestParam("openid") String openid,
@RequestParam(name = "encrypt_type", required = false) String encType,
@RequestParam(name = "msg_signature", required = false) String msgSignature,
XssHttpServletRequestWrapper requestWrapper){
//临时解决方案,采用requestWrapper.getInputSteam获取内容
String requestBody = HttpContextUtils.ReadAsChars2(requestWrapper);
....
}

from wx-api.

niefy avatar niefy commented on August 20, 2024

请更新代码到最新版验证此问题是否依然存在

from wx-api.

niefy avatar niefy commented on August 20, 2024

0.7 版本之后公众号接入地址有变更,从老版本升级的话需要重新接入

from wx-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.