From b4cc0adfca488819a689df734d12e868ca9e0409 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sat, 11 May 2024 10:06:34 +0800 Subject: [PATCH] =?UTF-8?q?1.warehouse=E8=80=81=E7=B3=BB=E7=BB=9F=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=A8=A1=E6=8B=9F=E7=99=BB=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/InterceptorAdapterConfig.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/InterceptorAdapterConfig.java diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/InterceptorAdapterConfig.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/InterceptorAdapterConfig.java new file mode 100644 index 000000000..edebf374b --- /dev/null +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/InterceptorAdapterConfig.java @@ -0,0 +1,24 @@ +package com.logpm.warehouse.config; + +import com.logpm.warehouse.config.interceptor.LocalServerLoginAccountsInterceptor; +import lombok.AllArgsConstructor; +import org.springblade.core.redis.cache.BladeRedis; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +@AllArgsConstructor +public class InterceptorAdapterConfig implements WebMvcConfigurer { + + private final BladeRedis redis; + + private final Environment environment; + + + @Override + public void addInterceptors(InterceptorRegistry interceptorRegistry) { + interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis,environment)).addPathPatterns("/oldpush/**").order(1); + } +}