调整拦截器的顺序
This commit is contained in:
+16
-16
@@ -190,22 +190,6 @@ public class InterceptorFactory {
|
||||
if (null == interceptors || null == intercept) {
|
||||
return;
|
||||
}
|
||||
if (ArrayUtil.notEmpty(intercept.value())) {
|
||||
for (Class<? extends Interceptor> clazz : intercept.value()) {
|
||||
Interceptor interceptor = get(clazz);
|
||||
if (null != interceptor && !interceptors.contains(interceptor)) {
|
||||
interceptors.add(interceptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ArrayUtil.notEmpty(intercept.exclude())) {
|
||||
for (Class<? extends Interceptor> clazz : intercept.exclude()) {
|
||||
Interceptor interceptor = get(clazz);
|
||||
if (null != interceptor && interceptors.contains(interceptor)) {
|
||||
interceptors.remove(interceptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ArrayUtil.notEmpty(intercept.filter()) || ArrayUtil.notEmpty(intercept.resultAdvice()) || ArrayUtil.notEmpty(intercept.exceptionHandler())) {
|
||||
InterceptorWrapper wrapper = new InterceptorWrapper();
|
||||
List<Filter> filterList = getFilterList(intercept.filter());
|
||||
@@ -222,6 +206,22 @@ public class InterceptorFactory {
|
||||
}
|
||||
interceptors.add(wrapper);
|
||||
}
|
||||
if (ArrayUtil.notEmpty(intercept.value())) {
|
||||
for (Class<? extends Interceptor> clazz : intercept.value()) {
|
||||
Interceptor interceptor = get(clazz);
|
||||
if (null != interceptor && !interceptors.contains(interceptor)) {
|
||||
interceptors.add(interceptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ArrayUtil.notEmpty(intercept.exclude())) {
|
||||
for (Class<? extends Interceptor> clazz : intercept.exclude()) {
|
||||
Interceptor interceptor = get(clazz);
|
||||
if (null != interceptor && interceptors.contains(interceptor)) {
|
||||
interceptors.remove(interceptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (intercept.ignoreGlobal()) {
|
||||
interceptors.removeAll(globalInterceptorList);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user