做毕设项目遇到一个问题
有下面几个权限
"/report/report", 增
"/report/delete", 删
"/report/update" 改
"/report/search" 查
"/admin/*" 管理员独立操作的路径
"/doctor/*" 医生独立操作的路径
"/family/*" 家属独立操作的路径
管理员
可以访问 "/admin/*"
以及增删改查 "/report/report" "/report/delete" "/report/update" "/report/search"
医生
可以访问 "/doctor/*"
以及增删改查 "/report/report" "/report/delete" "/report/update" "/report/search"
家属
可以访问 "/family/*"
以及查"/report/search"
这个怎么配置拦截器?
java
@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(loginCheckInterceptor)
.addPathPatterns("/**")
.excludePathPatterns("/user/login", "/user/register");
registry.addInterceptor(adminInterceptor).addPathPatterns(
"/admin/*"
);
registry.addInterceptor(doctorInterceptor).addPathPatterns(
"/doctor/*"
);
registry.addInterceptor(familyInterceptor).addPathPatterns(
"/family/*"
);
}
}