正在显示
1 个修改的文件
包含
24 行增加
和
0 行删除
| 1 | +package com.sunyo.wlpt.transport.provide.config; | ||
| 2 | + | ||
| 3 | +import org.springframework.context.annotation.Configuration; | ||
| 4 | +import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
| 5 | +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | ||
| 6 | +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * @author 子诚 | ||
| 10 | + * Description:SpringSecurity 权限配置框架 | ||
| 11 | + * 时间:2020/6/8 18:42 | ||
| 12 | + */ | ||
| 13 | +@EnableWebSecurity | ||
| 14 | +@Configuration | ||
| 15 | +public class SecurityConfig extends WebSecurityConfigurerAdapter { | ||
| 16 | + @Override | ||
| 17 | + protected void configure(HttpSecurity http) throws Exception { | ||
| 18 | + http.authorizeRequests() | ||
| 19 | + .antMatchers("/","/exit/**","/transport/**","/ws/**") | ||
| 20 | + .permitAll() | ||
| 21 | + .and() | ||
| 22 | + .csrf().disable(); | ||
| 23 | + } | ||
| 24 | +} |
-
请 注册 或 登录 后发表评论