159eaad1
王富生
集成swagger
|
1
2
3
4
|
package com.zteits.oa.configuration;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
28b60220
王富生
提交
|
5
6
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
159eaad1
王富生
集成swagger
|
7
8
9
10
11
12
13
14
15
16
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Configuration
@EnableWebMvc
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
|
159eaad1
王富生
集成swagger
|
17
18
|
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
|
159eaad1
王富生
集成swagger
|
19
20
21
|
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
|
28b60220
王富生
提交
|
22
23
24
25
26
|
}
/**
* 实现登陆拦截.<br/>
*/
|
900781d3
王富生
提交
|
27
28
29
30
31
32
33
34
35
36
37
38
39
|
// @Override
// public void addInterceptors(InterceptorRegistry registry) {
// InterceptorRegistration addInterceptor = null;//registry.addInterceptor();
//
// addInterceptor.excludePathPatterns("/error");
//
// addInterceptor.excludePathPatterns("/login**");
//
// addInterceptor.addPathPatterns("/**");
//
//
//
// }
|
28b60220
王富生
提交
|
40
41
|
|
159eaad1
王富生
集成swagger
|
42
|
}
|