问题:
Access to Font at 'http://www.oahome.cn/packages/admin/google-fonts/fonts/Source-Sans-Pro.woff2' from origin 'http://www.appblog.cn' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.appblog.cn' is therefore not allowed access.
在nginx.conf或vhosts的server下
location ~* \.(eot|otf|ttf|woff|woff2|svg)$ {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
}
也可以指定允许的url
add_header Access-Control-Allow-Origin http://www.appblog.cn;
注意:需要清空浏览器缓存才能生效