mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-10 06:09:12 +00:00
update 优化 请求结束清空上下文变量
This commit is contained in:
@@ -9,7 +9,6 @@ import jakarta.servlet.http.HttpServletRequest;
|
|||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.dromara.common.core.constant.HttpStatus;
|
import org.dromara.common.core.constant.HttpStatus;
|
||||||
import org.dromara.common.core.context.ThreadLocalHolder;
|
import org.dromara.common.core.context.ThreadLocalHolder;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||||
@@ -32,7 +31,7 @@ public class SecurityConfiguration implements WebMvcConfigurer {
|
|||||||
registry.addInterceptor(new SaInterceptor() {
|
registry.addInterceptor(new SaInterceptor() {
|
||||||
@Override
|
@Override
|
||||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
|
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
|
||||||
ThreadLocalHolder.remove(LoginHelper.LOGIN_USER_KEY);
|
ThreadLocalHolder.clear();
|
||||||
}
|
}
|
||||||
}).addPathPatterns("/**");
|
}).addPathPatterns("/**");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user