标签 前端 下的文章



XXX has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space private

处理方法:

1.在google浏览器地址栏输入chrome://flags/#block-insecure-private-network-requests回车,并设置block-insecure-private-network-requests为“disabled”,重启浏览器。
2.检查调用资源的域名DNS是否为内网地址,添加本地解析。

1.Nginx服务器配置:

location ^~/vue {
    alias /data/wwwroot/vue;
    index index.html;
    try_files $uri $uri/ /vue/index.html;
}

2.Apache服务器配置:

开启mod_rewrite模块,设置allowAllOveride All并在项目目录下创建.htaccess文件,内容如下:


  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /vue/index.html [L]

/**for FF/Chrome**/
.fix{
position:fixed;
top:100px;
left:200px;
}
/**for IE8、7、6**/
.ie-fix{
_position:absolute;
_clear:both;
_top:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop +(documentElement.clientHeight-this.clientHeight) - 1 : document.body.scrollTop +(document.body.clientHeight-this.clientHeight) - 1);
}