|
@@ -3,28 +3,25 @@ package com.ozs.web.filter;
|
|
|
import ch.qos.logback.classic.spi.ILoggingEvent;
|
|
|
import ch.qos.logback.core.filter.Filter;
|
|
|
import ch.qos.logback.core.spi.FilterReply;
|
|
|
-import com.ozs.common.constant.Constants;
|
|
|
import com.ozs.common.utils.SecurityUtils;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
-@Slf4j
|
|
|
+import javax.annotation.PostConstruct;
|
|
|
+
|
|
|
public class LogOutFilter extends Filter<ILoggingEvent> {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public FilterReply decide(ILoggingEvent event) {
|
|
|
- String s = Constants.localVar.get();
|
|
|
- if (!ObjectUtils.isEmpty(s)) {
|
|
|
- Long userId = SecurityUtils.getUserId();
|
|
|
- if (!ObjectUtils.isEmpty(userId)) {
|
|
|
- if (userId.equals(Long.parseLong("-1"))) {
|
|
|
- return FilterReply.DENY;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ if (getFlay()) {
|
|
|
+ return FilterReply.DENY;
|
|
|
}
|
|
|
return FilterReply.ACCEPT;
|
|
|
}
|
|
|
|
|
|
+ private boolean getFlay() {
|
|
|
+ return LogOutUtil.getFlay();
|
|
|
+ }
|
|
|
+
|
|
|
}
|