This commit is contained in:
周源 2021-10-22 15:10:38 +08:00
parent 8e0f2e82a3
commit 71dea05045
1 changed files with 11 additions and 4 deletions

View File

@ -3,13 +3,20 @@ package com.ydool.boot.api.config;
import com.ydool.boot.api.filter.ReferInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new ReferInterceptor()).addPathPatterns("/api/**");
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new ReferInterceptor()).addPathPatterns("/api/**");
}
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addRedirectViewController("/", "/page");
}
}