记得上下班打卡 | git大法好,push需谨慎

Commit b2279cd7 authored by jiangxiulong's avatar jiangxiulong

打开验签

parent 86d7e97e
...@@ -49,9 +49,8 @@ public class SweetWechatActionCallbackController { ...@@ -49,9 +49,8 @@ public class SweetWechatActionCallbackController {
@PostMapping("record") @PostMapping("record")
@ApiOperation("用户动作微信回调") @ApiOperation("用户动作微信回调")
public String record( public String record(
// @RequestBody String requestBody, @RequestBody String requestBody,
@RequestParam() String requestBody, // @RequestParam() String requestBody,
// @RequestParam("requestBody") String requestBody,
@RequestParam("type") Integer type, @RequestParam("type") Integer type,
@RequestParam("signature") String signature, @RequestParam("signature") String signature,
@RequestParam("timestamp") String timestamp, @RequestParam("timestamp") String timestamp,
...@@ -63,10 +62,10 @@ public class SweetWechatActionCallbackController { ...@@ -63,10 +62,10 @@ public class SweetWechatActionCallbackController {
log.info("\n接收微信请求:[type=[{}], openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}]," log.info("\n接收微信请求:[type=[{}], openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}],"
+ " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ", + " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
type, openid, signature, encType, msgSignature, timestamp, nonce, requestBody); type, openid, signature, encType, msgSignature, timestamp, nonce, requestBody);
/* if (!wechatSignUtils.checkSignature(signature, timestamp, nonce)) { if (!wechatSignUtils.checkSignature(signature, timestamp, nonce)) {
log.info("验签未通过,非法请求,可能属于伪造的请求!"); log.info("验签未通过,非法请求,可能属于伪造的请求!");
return ""; return "";
}*/ }
return sweetWechatCallbackService.record(requestBody, type, timestamp, nonce, encType, msgSignature); return sweetWechatCallbackService.record(requestBody, type, timestamp, nonce, encType, msgSignature);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment