From ffb8bbdd3b3a699582fb6dfc3ee8e3aa0bf66c96 Mon Sep 17 00:00:00 2001 From: diaobisong Date: Thu, 25 Jan 2024 18:05:14 +0800 Subject: [PATCH] fix code --- .../java/com/java3y/austin/web/config/CrossConfig.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/austin-web/src/main/java/com/java3y/austin/web/config/CrossConfig.java b/austin-web/src/main/java/com/java3y/austin/web/config/CrossConfig.java index 8d06093..67e8dcb 100644 --- a/austin-web/src/main/java/com/java3y/austin/web/config/CrossConfig.java +++ b/austin-web/src/main/java/com/java3y/austin/web/config/CrossConfig.java @@ -1,7 +1,9 @@ package com.java3y.austin.web.config; +import com.java3y.austin.web.interceptor.TokenInterceptor; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** @@ -19,4 +21,9 @@ public class CrossConfig implements WebMvcConfigurer { .maxAge(3600) .allowedHeaders("*"); } + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(new TokenInterceptor()).addPathPatterns("/**"); + } }