Explorar o código

fix: 允许TEACHER角色登录。

ddch@smail.nju.edu.cn %!s(int64=5) %!d(string=hai) anos
pai
achega
fb5f41c6f4

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

@@ -110,7 +110,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .authorizeRequests()
                 .authorizeRequests()
                 //跨域的Options请求进行放行
                 //跨域的Options请求进行放行
                 .requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
                 .requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
-                .antMatchers("/**").hasAnyRole(WebSecurityConstants.STUDENT_ROLE, WebSecurityConstants.ADMIN_ROLE)
+                .antMatchers("/**").hasAnyRole(WebSecurityConstants.STUDENT_ROLE, WebSecurityConstants.ADMIN_ROLE, WebSecurityConstants.TEACHER_ROLE)
                 //其他所有接口都要在登陆认证状态下请求
                 //其他所有接口都要在登陆认证状态下请求
                 .anyRequest().authenticated();
                 .anyRequest().authenticated();