|
@@ -1,8 +1,11 @@
|
|
|
package com.hys.app.controller.erp.use;
|
|
|
|
|
|
+import com.hys.app.framework.util.ScriptUtil;
|
|
|
import org.dom4j.Document;
|
|
|
import org.dom4j.DocumentHelper;
|
|
|
import org.dom4j.Element;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.security.MessageDigest;
|
|
@@ -11,6 +14,8 @@ import java.util.Arrays;
|
|
|
@RestController
|
|
|
public class WeixinController {
|
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(ScriptUtil.class);
|
|
|
+
|
|
|
private static final String TOKEN = "ryks2023weixin"; // 替换为您在微信公众平台设置的Token
|
|
|
|
|
|
@GetMapping("/weixin")
|
|
@@ -43,6 +48,8 @@ public class WeixinController {
|
|
|
@RequestParam("msg_signature") String msgSignature,
|
|
|
@RequestParam("timestamp") String timestamp,
|
|
|
@RequestParam("nonce") String nonce) {
|
|
|
+
|
|
|
+ log.info("验证来了啊 -----------------------------------------------------------11111111111111111---------");
|
|
|
try {
|
|
|
// 1. 验证消息的真实性
|
|
|
if (!verifySignature(msgSignature, timestamp, nonce, requestBody)) {
|