Browse Source

Merge branch 'lyy_fix_springSecurityWithJwt' of WengPuHong/seecoder-devcloud into master

LiuYiYe 5 years ago
parent
commit
0a0dfc4068

+ 6 - 4
web/src/main/java/cn/seecoder/web/infrastructure/config/WebSecurityConfig.java

@@ -51,10 +51,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
 //                .antMatchers("/**/*api-docs*/**").permitAll()
 //                .antMatchers("/**/hook").permitAll()
 //                .antMatchers("/**/query/**").permitAll()
-                .antMatchers("/**/*swagger*/**").anonymous()
-                .antMatchers("/**/*api-docs*/**").anonymous()
-                .antMatchers("/**/hook").anonymous()
-                .antMatchers("/**/query/**").anonymous()
+
 //
 //                .and()
 //                .authorizeRequests()
@@ -112,6 +109,11 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers(HttpMethod.POST, "/api/tree/subNode/{fatherId}").access("@authTools.checkTreeNodeOwnership(#fatherId)")
                 .antMatchers(HttpMethod.PUT, "/api/tree/node").access("@authTools.checkTreeNodeOwnershipBody(request)")
                 .antMatchers(HttpMethod.PUT, "/api/tree/node/type/task/{projectId}").access("@authTools.checkProjOwnership(#projectId)")
+                // Swagger
+                .antMatchers("/**/*swagger*/**").anonymous()
+                .antMatchers("/**/*api-docs*/**").anonymous()
+                .antMatchers("/**/hook").anonymous()
+                .antMatchers("/**/query/**").anonymous()
                 //跨域的Options请求进行放行
                 .requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
                 .antMatchers("/**").hasAnyRole(WebSecurityConstants.STUDENT_ROLE, WebSecurityConstants.ADMIN_ROLE, WebSecurityConstants.TEACHER_ROLE)