Преглед на файлове

fix: 允许TEACHER角色登录。

ddch@smail.nju.edu.cn преди 5 години
родител
ревизия
fb5f41c6f4
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      web/src/main/java/cn/seecoder/web/infrastructure/config/WebSecurityConfig.java

+ 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();