上传微信公众号
parent
3a39e06292
commit
d475aee508
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxProjectSettings">
|
||||
<option name="commitMessageIssueKeyValidationOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
<option name="commitMessageValidationEnabledOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
|
@ -1,29 +1,13 @@
|
|||
package com.muyu.controller;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.muyu.domain.Message;
|
||||
import com.muyu.service.WxService;
|
||||
import com.muyu.util.OkHttpUtils;
|
||||
import com.muyu.util.TokenUtil;
|
||||
import com.muyu.util.WechatUtil;
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import io.micrometer.common.util.StringUtils;
|
||||
import jakarta.servlet.ServletInputStream;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import okhttp3.*;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.Element;
|
||||
import org.dom4j.io.SAXReader;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.muyu.service.WxService;
|
||||
import com.muyu.util.WechatUtil;
|
||||
import io.micrometer.common.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.*;
|
||||
|
@ -35,6 +19,7 @@ import java.util.*;
|
|||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Log4j2
|
||||
@RestController
|
||||
public class WxController {
|
||||
|
||||
|
@ -44,19 +29,11 @@ public class WxController {
|
|||
@Autowired
|
||||
private WxService wxService;
|
||||
|
||||
/**
|
||||
* 消息验证,验证是否是微信
|
||||
* @param signature
|
||||
* @param timestamp
|
||||
* @param nonce
|
||||
* @param echostr
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/")
|
||||
public String check(@RequestParam("signature") String signature,@RequestParam("timestamp") String timestamp ,
|
||||
@RequestParam("nonce") String nonce, @RequestParam("echostr") String echostr){
|
||||
|
||||
String token ="zzhdzt";
|
||||
String token ="YangPeng";
|
||||
List<String> list = Arrays.asList(token, timestamp, nonce);
|
||||
Collections.sort(list);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
|
Loading…
Reference in New Issue