项目中用到iframe嵌入网页,然后用到springsecurity就被拦截了 浏览器报错 x-frame-options deny
原因是因为springSecurty使用X-Frame-Options防止网页被Frame
解决办法把x-frame-options disable即可
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/js/**","/css/**","/img/**","/layui/**","/layouts/**","/font-awesome/**").permitAll()
.anyRequest().authenticated() // "/index",
.and()
.headers().frameOptions().disable()
.and()
.formLogin()
.loginPage("/login")
.defaultSuccessUrl("/index", true)
.permitAll()
.and()
.logout()
.permitAll();
}