BAOLH
2025-02-19 031eca402975d8f3811d431590698474465d319c
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/impl/WechatSendHistoryServiceImpl.java
@@ -15,10 +15,8 @@
*/
package me.zhengjie.modules.temp.service.impl;
import ch.ethz.ssh2.crypto.digest.SHA1;
import me.zhengjie.modules.temp.domain.WechatSendHistory;
import me.zhengjie.utils.ValidationUtil;
import me.zhengjie.utils.FileUtil;
import me.zhengjie.utils.*;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.temp.repository.WechatSendHistoryRepository;
import me.zhengjie.modules.temp.service.WechatSendHistoryService;
@@ -30,11 +28,10 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import me.zhengjie.utils.PageUtil;
import me.zhengjie.utils.QueryHelp;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
@@ -111,14 +108,22 @@
    }
    @Override
    public String approvalBack(String msgSignature, String timestamp, String nonce, String echostr, HttpServletResponse response) {
    public void approvalBack(String msgSignature, String timestamp, String nonce, String echostr, HttpServletResponse response) {
        try {
            WXBizJsonMsgCrypt wxcpt = new WXBizJsonMsgCrypt(TOKEN, ENCODING_AES_KEY, CORP_ID);
            return wxcpt.VerifyURL(msgSignature, timestamp, nonce, echostr);
            // 设置响应内容类型为纯文本
            response.setContentType("text/plain; charset=UTF-8");
            // 获取PrintWriter对象
            PrintWriter out = response.getWriter();
            // 直接返回
            String message = wxcpt.VerifyURL(msgSignature, timestamp, nonce, echostr);
            out.print(message);
            // 刷新并关闭PrintWriter
            out.flush();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    @Override