|
|
|
@@ -18,6 +18,7 @@ import com.simple.domain.po.WxCUserCar; |
|
|
|
import com.simple.service.WxAppinfoService; |
|
|
|
import com.simple.service.WxCUserCarService; |
|
|
|
import com.simple.service.WxCUserService; |
|
|
|
import com.simple.utils.CheckUtil; |
|
|
|
import com.simple.utils.IPUtil; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
@@ -32,6 +33,9 @@ import org.springframework.web.context.request.RequestContextHolder; |
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.PrintWriter; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
@@ -319,5 +323,34 @@ public class WxUserGrantController extends BaseController { |
|
|
|
return new ResultData(Result.SUCCESS,"获取查询成功", list); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 微信消息服务验证 |
|
|
|
* @param response |
|
|
|
* @param request |
|
|
|
* @throws IOException |
|
|
|
*/ |
|
|
|
@RequestMapping(value = "/signature") |
|
|
|
@ResponseBody |
|
|
|
public void signature(HttpServletResponse response, HttpServletRequest request) throws IOException { |
|
|
|
|
|
|
|
|
|
|
|
String signature = request.getParameter("signature"); |
|
|
|
String timestamp = request.getParameter("timestamp"); |
|
|
|
String nonce = request.getParameter("nonce"); |
|
|
|
String echostr = request.getParameter("echostr"); |
|
|
|
|
|
|
|
logger.warn("收到的微信服务验证信息"+signature+"\n"+timestamp+"\n"+nonce+"\n"+echostr); |
|
|
|
PrintWriter out = response.getWriter(); |
|
|
|
/* |
|
|
|
// 通过检验signature对请求进行校验,若校验成功则原样返回echostr,表示接入成功,否则接入失败 |
|
|
|
if (CheckUtil.checkSignature(wp.getToken(), signature, timestamp, nonce)) { |
|
|
|
out.print(echostr); |
|
|
|
logger.warn("微信服务验证成功===================="+echostr); |
|
|
|
System.out.println("微信服务验证成功!"); |
|
|
|
} |
|
|
|
*/ |
|
|
|
out.close(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |