|
|
|
@ -5,21 +5,24 @@ import com.logpm.factory.interceptor.FactoryAccountsInterceptor;
|
|
|
|
|
import com.logpm.factory.interceptor.LocalServerLoginAccountsInterceptor; |
|
|
|
|
import com.logpm.factory.interceptor.ZbFactoryAccountsInterceptor; |
|
|
|
|
import com.logpm.factory.props.ZbFactoryProperties; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springblade.core.redis.cache.BladeRedis; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.context.annotation.Configuration; |
|
|
|
|
import org.springframework.core.env.Environment; |
|
|
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistration; |
|
|
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
|
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
|
|
|
|
|
|
|
|
|
@Configuration |
|
|
|
|
@AllArgsConstructor |
|
|
|
|
public class InterceptorAdapterConfig implements WebMvcConfigurer { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
IFactoryTokenService factoryTokenService; |
|
|
|
|
private final IFactoryTokenService factoryTokenService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private BladeRedis redis; |
|
|
|
|
private final BladeRedis redis; |
|
|
|
|
|
|
|
|
|
private final Environment environment; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -30,13 +33,7 @@ public class InterceptorAdapterConfig implements WebMvcConfigurer {
|
|
|
|
|
excludePathPatterns("/factory/oupai/**"). |
|
|
|
|
excludePathPatterns("/factory/zb/**") |
|
|
|
|
.excludePathPatterns("/factory/common/**"); |
|
|
|
|
registry=interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis)); |
|
|
|
|
// registry.addPathPatterns("/factory/**").
|
|
|
|
|
// excludePathPatterns("/factory/auth/token").
|
|
|
|
|
// excludePathPatterns("/factory/oupai/**").
|
|
|
|
|
// excludePathPatterns("/factory/zb/**")
|
|
|
|
|
// .excludePathPatterns("/factory/common/**");
|
|
|
|
|
// InterceptorRegistration registryZbFactory = interceptorRegistry.addInterceptor(new ZbFactoryAccountsInterceptor(zbFactoryProperties));
|
|
|
|
|
// registryZbFactory.addPathPatterns("/factory/zb/**");
|
|
|
|
|
registry=interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis,environment)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|