diff --git a/epmet-auth/src/main/java/com/epmet/controller/WxController.java b/epmet-auth/src/main/java/com/epmet/controller/WxController.java index 5723e7106a..3ea0b091a5 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/WxController.java +++ b/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; + } + + }