作者 王勇

忘记了安全认证,加上了springsecurity

  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 +}