jianjun 4 years ago
parent
commit
94e7f017cb
  1. 25
      epmet-auth/src/main/java/com/epmet/controller/WxController.java

25
epmet-auth/src/main/java/com/epmet/controller/WxController.java

@ -4,6 +4,8 @@ package com.epmet.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@ -114,4 +116,27 @@ public class WxController {
String s = new String(tempArr);
return s;
}
/**
* 打开开发者模式签名认证
* @param signature
* @param timestamp
* @param nonce
* @param echostr
* @return
*/
@ResponseBody
@RequestMapping(value = "/service", method = RequestMethod.GET)
public Object defaultView(String signature, String timestamp, String nonce, String echostr) {
if (echostr == null || echostr.isEmpty()) {
return nonce;
}
if (this.checkSignature(signature, timestamp, nonce)) {
return echostr;
}
return nonce;
}
}

Loading…
Cancel
Save