axios+ spring boot oauth2.0 resource server 获取不到状态值

resource server配置

@Configuration
@EnableResourceServer
public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter {

    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests().requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
                //如果没有这段代码要加上
                .and().cors()
                //如果有这段代码要去掉
                .and().csrf().disable();
    }
}

SecurityConfiguration

@Configuration
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {

    @Bean
    @Override
    public AuthenticationManager authenticationManagerBean() throws Exception {
        return super.authenticationManagerBean();
    }
}

你可能感兴趣的:(Spring,Boot,前端,微服务,Spring,Cloud)