1 回答
TA贡献1862条经验 获得超6个赞
为什么不使用如下所示:
http
.cors()
.and()
.csrf()
.disable()
.exceptionHandling()
.authenticationEntryPoint(unauthorizedHandler)
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers("/")
.permitAll()
.antMatchers("/api/auth/**","/api/user/exist")
.permitAll()
.antMatchers("/api/user/checkUsernameAvailability", "/api/user/checkEmailAvailability")
.permitAll()
.antMatchers(HttpMethod.GET, "/api/polls/**", "/api/users/**", "/api/gift/**")
.permitAll()
.anyRequest()
.authenticated();
添加回答
举报