我尝试了下面的代码来允许js和css文件。
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/v2/api-docs",
"/configuration/ui",
"/swagger-resources/**",
"/configuration/security",
"/swagger-ui.html",
"/webjars/**",
"/graphiql",
"/resources/**"
);
}
/*@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/resources/**"); // #3
}*/
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/resources/**").permitAll()
.antMatchers("/*.js").permitAll()
.antMatchers("/*.css").permitAll()
.antMatchers("/*.html").permitAll()
.and().csrf().disable();
} 我觉得Graphiql UI有问题?有人能帮帮忙吗?
对于query GraphiQL UI的参考GraphiQL UI
发布于 2020-06-30 19:40:06
我使用了下一个匹配器来渲染graphiQl
.antMatchers("/graphiql", "/vendor/**").permitAll()GraphiQL版本为5.0.2
https://stackoverflow.com/questions/57883739
复制相似问题