|
@@ -38,20 +38,31 @@ public class WebHandlerAdapter implements HandlerInterceptor {
|
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
|
HandlerMethod handlerMethod = (HandlerMethod) handler;
|
|
HandlerMethod handlerMethod = (HandlerMethod) handler;
|
|
//推送数据的签名校验
|
|
//推送数据的签名校验
|
|
- PushDataCheck pushCheck = handlerMethod.getMethod().getAnnotation(PushDataCheck.class);
|
|
|
|
- //数据推送签名校验
|
|
|
|
- if (pushCheck != null) {
|
|
|
|
|
|
+ PushDataCheck[] pushDataChecks = handlerMethod.getMethod().getAnnotationsByType(PushDataCheck.class);
|
|
|
|
+ if (pushDataChecks.length != 0){
|
|
|
|
+ log.error("PushDataCheck注解拿到了, 长度为 : {}", pushDataChecks.length);
|
|
this.pushCheck(request);
|
|
this.pushCheck(request);
|
|
}
|
|
}
|
|
- log.error("推送注解获取到为空");
|
|
|
|
|
|
+ log.error("PushDataCheck注解为kong");
|
|
//排除签名认证接口注解
|
|
//排除签名认证接口注解
|
|
- UnSignCheck unSignCheck = handlerMethod.getMethod().getAnnotation(UnSignCheck.class);
|
|
|
|
- //接口签名验证
|
|
|
|
- if (unSignCheck == null) {
|
|
|
|
- return this.signCheck(request);
|
|
|
|
|
|
+ UnSignCheck[] unSignChecks = handlerMethod.getMethod().getAnnotationsByType(UnSignCheck.class);
|
|
|
|
+ if (unSignChecks.length != 0){
|
|
|
|
+ log.error("UnSignCheck注解拿到了, 长度为 : {}", unSignChecks.length);
|
|
|
|
+ return Boolean.TRUE;
|
|
}
|
|
}
|
|
- log.error("UnSignCheck注解获取到不是kong");
|
|
|
|
- return Boolean.TRUE;
|
|
|
|
|
|
+ log.error("UnSignCheck注解为kong");
|
|
|
|
+ return this.signCheck(request);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// UnSignCheck unSignCheck = handlerMethod.getMethod().getAnnotation(UnSignCheck.class);
|
|
|
|
+// //接口签名验证
|
|
|
|
+// if (unSignCheck == null) {
|
|
|
|
+// return this.signCheck(request);
|
|
|
|
+// }
|
|
|
|
+// log.error("UnSignCheck注解获取到不是kong");
|
|
|
|
+// return Boolean.TRUE;
|
|
}
|
|
}
|
|
|
|
|
|
private boolean signCheck(HttpServletRequest request) throws Exception {
|
|
private boolean signCheck(HttpServletRequest request) throws Exception {
|