关于spingboot使用springsecurity时iframe中的内容无法显示的问题
错误提示:Load denied by X-Frame-Options: http://localhost:8088/admin/emailRecords does not permit framing.
解决办法:
继承WebSecurityConfigurerAdapter方法
重写configure(HttpSecurity http)
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/","/level1/1","/static/**").permitAll()
.antMatchers("/login.html").permitAll()
.antMatchers("/level1/**").hasRole("vip1")
.antMatchers("/level2/**").hasRole("vip2")
.antMatchers("/admin/**").hasRole("vip2")
.antMatchers("/admincs").hasRole("vip2")
.antMatchers("/level3/**").hasRole("vip3");
http.formLogin()
// .loginPage("/login").permitAll()
.successForwardUrl("/admincs")
.failureUrl("/view/error")
.and()
.csrf().disable();
http.logout().and();
**http.headers().frameOptions().disable();**
}