merge
This commit is contained in:
@@ -7,10 +7,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.springframework.web.servlet.config.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -66,12 +63,26 @@ public class DispatcherServletConfig extends WebMvcConfigurerAdapter {
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry) {
|
||||
registry.addViewController("/").setViewName("login.html");
|
||||
registry.addRedirectViewController("doc","swagger-ui.html");
|
||||
registry.addRedirectViewController("doc", "swagger-ui.html");
|
||||
//添加更多
|
||||
registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
|
||||
super.addViewControllers(registry);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解决跨域
|
||||
*
|
||||
* @param registry
|
||||
*/
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins("*")
|
||||
.allowCredentials(true)
|
||||
.allowedMethods("GET", "POST", "DELETE", "PUT", "OPTIONS")
|
||||
.maxAge(3600);
|
||||
}
|
||||
|
||||
/**
|
||||
* 扩展消息转换器,增加fastjson
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user