vue 使用 ifame 嵌套网页的时候报 Refused to display 'http://192.168.179.62:8781/' in a frame because it set 'X-Frame-Options' to 'deny'. 错误
这是被后端拒绝了,然后我百度了一下更改了 spring security 的配置
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
...
http.headers().frameOptions().sameOrigin();
}
}
结果又报下面的错误
这样设置应该是相同域名才可以访问。
然后 我用 http.headers().frameOptions().disable(); //禁用
这样不同域名的都可以调用访问。
上面总算是解决了,因为IFRAME里面页面需要登录又报了以下的错误:
Blocked autofocusing on a element in a cross-origin subframe.
...
最后还是在新页面打开页面算了



