zxl
9 天以前 3b0516a2959e25576e4f3fda697a3b025d06c8c9
ycl-server/src/main/java/com/ycl/config/SecurityConfig.java
@@ -24,8 +24,6 @@
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.authentication.logout.LogoutFilter;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
/**
@@ -71,7 +69,7 @@
    /**
     * 允许匿名访问的地址
     */
    @Autowired
    @Resource
    private PermitAllUrlProperties permitAllUrl;
    @Bean
@@ -100,8 +98,10 @@
                .authorizeRequests()
                // 对于登录login 注册register 验证码captchaImage 允许匿名访问
                .requestMatchers("/login", "/register", "/captchaImage").permitAll()
                // py推送psd数据接口
                .requestMatchers("/py/syn/osd").permitAll()
                // 静态资源,可匿名访问
                .requestMatchers(HttpMethod.GET, "/", "/*.html", "/*/*.html", "/*/*.css", "/*/*.js", "/profile/*").permitAll()
                .requestMatchers(HttpMethod.GET, "/", "/*.html", "/*/*.html", "/*/*.css", "/*/*.js",  "/profile/**").permitAll()
                .requestMatchers("/swagger-ui.html", "/swagger-resources/*", "/webjars/*", "/*/api-docs", "/druid/*").permitAll()
                // 除上面外的所有请求全部需要鉴权认证
                .anyRequest().authenticated()