提交 | 用户 | 时间
|
e7c126
|
1 |
package com.xxl.job.admin.controller.interceptor; |
H |
2 |
|
|
3 |
import org.springframework.context.annotation.Configuration; |
|
4 |
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
|
5 |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
|
6 |
|
|
7 |
import javax.annotation.Resource; |
|
8 |
|
|
9 |
/** |
|
10 |
* web mvc config |
|
11 |
* |
|
12 |
* @author xuxueli 2018-04-02 20:48:20 |
|
13 |
*/ |
|
14 |
@Configuration |
|
15 |
public class WebMvcConfig implements WebMvcConfigurer { |
|
16 |
|
|
17 |
@Resource |
|
18 |
private PermissionInterceptor permissionInterceptor; |
|
19 |
@Resource |
|
20 |
private CookieInterceptor cookieInterceptor; |
|
21 |
|
|
22 |
@Override |
|
23 |
public void addInterceptors(InterceptorRegistry registry) { |
|
24 |
registry.addInterceptor(permissionInterceptor).addPathPatterns("/**"); |
|
25 |
registry.addInterceptor(cookieInterceptor).addPathPatterns("/**"); |
|
26 |
} |
|
27 |
|
|
28 |
} |