配置拦截器,redis
This commit is contained in:
parent
71bb8cdab6
commit
b70501c750
|
@ -17,17 +17,12 @@ public class InterceptorConfig implements WebMvcConfigurer {
|
|||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {//配置拦截器
|
||||
System.out.println("拦截器被配置了");
|
||||
ArrayList<String> excludePath = new ArrayList<>();
|
||||
excludePath.add("/login");//登录
|
||||
excludePath.add("/checkCode");
|
||||
excludePath.add("/sendCode");
|
||||
excludePath.add("/register");//注册
|
||||
excludePath.add("/apiSend");
|
||||
excludePath.add("/timeChange");
|
||||
excludePath.add("/timeGet");
|
||||
|
||||
excludePath.add("/index/modifyHead");
|
||||
registry.addInterceptor(tokenInterceptor)//注册拦截器
|
||||
.addPathPatterns("/**")//拦截所有请求
|
||||
.excludePathPatterns(excludePath);//添加拦截白名单
|
||||
|
|
|
@ -2,9 +2,11 @@ spring:
|
|||
application:
|
||||
name: AITest
|
||||
redis:
|
||||
|
||||
port: 6379
|
||||
# password: ob666666
|
||||
host: localhost
|
||||
host: 49.233.248.140
|
||||
password: aB3cDeF9
|
||||
datasource:
|
||||
username: root
|
||||
password: 3534957771fb4925
|
||||
|
|
Loading…
Reference in New Issue