package com.llisoft.sms.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** * 配置spring mvc * @author YangJie [2018年12月25日] */ @Configuration public class SpringMvcConfig implements WebMvcConfigurer { @Override // 默认首页 public void addViewControllers(ViewControllerRegistry registry) { registry.addRedirectViewController("/", "/swagger-ui.html"); } // @Override // 跨域配置 // public void addCorsMappings(CorsRegistry registry) { // registry.addMapping("/**") // .allowedOrigins("*") // .allowedHeaders("*") // .allowedMethods("POST", "OPTIONS"); // } }