Pārlūkot izejas kodu

update tt

master
xhxu pirms 3 gadiem
vecāks
revīzija
07bc73edc3
1 mainītis faili ar 7 papildinājumiem un 7 dzēšanām
  1. +7
    -7
      mlToutiaoOpen/src/main/java/com/iformall/controller/TtCalllbackController.java

+ 7
- 7
mlToutiaoOpen/src/main/java/com/iformall/controller/TtCalllbackController.java Parādīt failu

@@ -60,16 +60,16 @@ public class TtCalllbackController extends BaseController {
@PostMapping(value = "/notify") @PostMapping(value = "/notify")
@ApiOperation("接收ticket回调") @ApiOperation("接收ticket回调")
@ResponseBody @ResponseBody
public String receiveTicket(HttpServletRequest request) throws IOException {
public String receiveTicket(@RequestBody Map<String, String> params) throws IOException {
logger.info("[" + getIpAddr() + "]接收微信回调 /ttOpen/notify"); logger.info("[" + getIpAddr() + "]接收微信回调 /ttOpen/notify");


String nonce = request.getParameter("Nonce");
String timestamp = request.getParameter("TimeStamp");
// String signature = request.getParameter("signature");
String encrypt = request.getParameter("Encrypt");
String msgSignature = request.getParameter("MsgSignature");
String nonce = params.get("Nonce");
String timestamp = params.get("TimeStamp");
// String signature = params.get("signature");
String encrypt = params.get("Encrypt");
String msgSignature = params.get("MsgSignature");


if (openService.getTtOpenComponentService().checkSignature(timestamp, nonce, encrypt, msgSignature)) {
if (!openService.getTtOpenComponentService().checkSignature(timestamp, nonce, encrypt, msgSignature)) {
throw new IllegalArgumentException("非法请求,可能属于伪造的请求!"); throw new IllegalArgumentException("非法请求,可能属于伪造的请求!");
} }
// aes加密的消息, 解密 // aes加密的消息, 解密


Notiek ielāde…
Atcelt
Saglabāt