| | |
| | | // 静态资源,可匿名访问 |
| | | // todo 设置部门管理员可以看的请求 |
| | | .antMatchers("/api/admin/**").hasAnyRole(RoleEnum.ADMIN.getName(), RoleEnum.DEPT_ADMIN.getName()) |
| | | .antMatchers("/api/student/**").hasRole(RoleEnum.STUDENT.getName()) |
| | | .antMatchers("/api/student/**").hasAnyRole(RoleEnum.STUDENT.getName(), RoleEnum.DEPT_ADMIN.getName()) |
| | | .anyRequest().permitAll() |
| | | .and().exceptionHandling().accessDeniedHandler(restAccessDeniedHandler) |
| | | .and().formLogin().successHandler(restAuthenticationSuccessHandler).failureHandler(restAuthenticationFailureHandler) |