首页>代码>SpringBoot+Thymeleaf+内嵌数据库H2+SpringData JPA简单党员信息管理系统>/party-member-management/src/main/java/com/no1/config/MyMvcConfig.java
package com.no1.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
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 MyMvcConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
//registry.addViewController("/").setViewName("login");
registry.addViewController("/").setViewName("login");
registry.addViewController("/index.html").setViewName("login");
}
//注册拦截器
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new LoginHandlerInterceptor()).addPathPatterns("/**")
.excludePathPatterns("/index.html","/","/login","/webjars/**","/asserts/**","/login/**","/index/**");
}
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(new StringToDate());
}
}
最近下载更多
1941549176 LV4
2024年5月10日
xiaoyu111ewsd LV4
2024年2月29日
masstter LV1
2023年11月17日
linmou LV8
2023年3月13日
jlmarket LV22
2022年12月2日
werqjkl LV5
2022年9月30日
black8angel LV4
2022年9月21日
yunYUN123 LV1
2022年6月9日
interface LV22
2022年5月29日
wanglinddad LV55
2021年12月26日

最近浏览