|
@@ -15,34 +15,34 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
@Configuration
|
|
|
public class SaTokenConfigure implements WebMvcConfigurer {
|
|
|
|
|
|
- @Bean
|
|
|
- public SaServletFilter getSaServletFilter() {
|
|
|
- return new SaServletFilter()
|
|
|
- .addInclude(Constants.REPORT_API + "/**")
|
|
|
- .addExclude("/favicon.ico")
|
|
|
- .setAuth(obj -> {
|
|
|
- SaRouter.match(Constants.REPORT_API + "/**")
|
|
|
- .notMatch(
|
|
|
- Constants.REPORT_API + "/ws/**",
|
|
|
- Constants.REPORT_API + "/test/**",
|
|
|
- Constants.REPORT_API + "/oauth2/**",
|
|
|
- Constants.REPORT_API + "/admin/**",
|
|
|
- Constants.REPORT_API + "/common/download",
|
|
|
- Constants.REPORT_API + "/common/export",
|
|
|
- Constants.REPORT_API + "/common/download",
|
|
|
- Constants.REPORT_API + "/admin/login",
|
|
|
- Constants.REPORT_API + "/system/**"
|
|
|
- ).check(StpUtil::checkLogin);
|
|
|
- //SaRouter.match(Constants.PERMISSION_API + "/admin/**", Constants.PERMISSION_API + "/admin/login", StpAdminUtil::checkLogin);
|
|
|
- })
|
|
|
- .setError(e -> Response.error(ResponseEnum.UNAUTHORIZED));
|
|
|
- }
|
|
|
-
|
|
|
- // 注册Sa-Token的注解拦截器,打开注解式鉴权功能
|
|
|
- @Override
|
|
|
- public void addInterceptors(InterceptorRegistry registry) {
|
|
|
- // 注册注解拦截器,并排除不需要注解鉴权的接口地址 (与登录拦截器无关)
|
|
|
- registry.addInterceptor(new SaAnnotationInterceptor()).addPathPatterns("/**");
|
|
|
- }
|
|
|
+// @Bean
|
|
|
+// public SaServletFilter getSaServletFilter() {
|
|
|
+// return new SaServletFilter()
|
|
|
+// .addInclude(Constants.REPORT_API + "/**")
|
|
|
+// .addExclude("/favicon.ico")
|
|
|
+// .setAuth(obj -> {
|
|
|
+// SaRouter.match(Constants.REPORT_API + "/**")
|
|
|
+// .notMatch(
|
|
|
+// Constants.REPORT_API + "/ws/**",
|
|
|
+// Constants.REPORT_API + "/test/**",
|
|
|
+// Constants.REPORT_API + "/oauth2/**",
|
|
|
+// Constants.REPORT_API + "/admin/**",
|
|
|
+// Constants.REPORT_API + "/common/download",
|
|
|
+// Constants.REPORT_API + "/common/export",
|
|
|
+// Constants.REPORT_API + "/common/download",
|
|
|
+// Constants.REPORT_API + "/admin/login",
|
|
|
+// Constants.REPORT_API + "/system/**"
|
|
|
+// ).check(StpUtil::checkLogin);
|
|
|
+// //SaRouter.match(Constants.PERMISSION_API + "/admin/**", Constants.PERMISSION_API + "/admin/login", StpAdminUtil::checkLogin);
|
|
|
+// })
|
|
|
+// .setError(e -> Response.error(ResponseEnum.UNAUTHORIZED));
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 注册Sa-Token的注解拦截器,打开注解式鉴权功能
|
|
|
+// @Override
|
|
|
+// public void addInterceptors(InterceptorRegistry registry) {
|
|
|
+// // 注册注解拦截器,并排除不需要注解鉴权的接口地址 (与登录拦截器无关)
|
|
|
+// registry.addInterceptor(new SaAnnotationInterceptor()).addPathPatterns("/**");
|
|
|
+// }
|
|
|
|
|
|
}
|