| | |
| | | |
| | | import com.ycl.jxkg.config.property.CookieConfig; |
| | | import com.ycl.jxkg.config.property.SystemConfig; |
| | | import com.ycl.jxkg.domain.enums.RoleEnum; |
| | | import com.ycl.jxkg.enums.RoleEnum; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | |
| | | .authorizeRequests() |
| | | .antMatchers(securityIgnoreUrls.toArray(ignores)).permitAll() |
| | | .antMatchers("/api/admin/**").hasRole(RoleEnum.ADMIN.getName()) |
| | | .antMatchers("/api/student/**").hasRole(RoleEnum.STUDENT.getName()) |
| | | .antMatchers("/api/student/**").hasAnyRole(RoleEnum.STUDENT.getName(),RoleEnum.ADMIN.getName()) |
| | | .antMatchers("/api/register/**").anonymous() |
| | | .anyRequest().permitAll() |
| | | .and().exceptionHandling().accessDeniedHandler(restAccessDeniedHandler) |