mirror of
https://github.com/qiurunze123/miaosha.git
synced 2023-11-19 22:41:03 +08:00
config AccessInterceptor
This commit is contained in:
parent
1ff919d21e
commit
a1c90d0446
|
@ -1,8 +1,10 @@
|
|||
package com.geekq.miaosha.config;
|
||||
|
||||
import com.geekq.miaosha.access.AccessInterceptor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -13,6 +15,15 @@ public class WebConfig extends WebMvcConfigurerAdapter {
|
|||
@Autowired
|
||||
UserArgumentResolver userArgumentResolver;
|
||||
|
||||
@Autowired
|
||||
private AccessInterceptor accessInterceptor;
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
super.addInterceptors(registry);
|
||||
registry.addInterceptor(accessInterceptor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
|
||||
argumentResolvers.add(userArgumentResolver);
|
||||
|
|
Loading…
Reference in New Issue
Block a user