如圖所示如果遇到圖標(biāo)不顯示時(shí),那么一定是域名不一致導(dǎo)致的,網(wǎng)絡(luò)圖標(biāo)字體不允許跨域訪問,那么如何開啟跨域訪問?
1、apache 在httpd.conf 尾部加上
LoadModule headers_module modules/mod_headers.so
<IfModule mod_headers.c> # Make sure proxies don’t deliver the wrong contentHeader append Vary User-Agent env=!dont-vary <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css)$"> Header set Access-Control-Allow-Origin "*" </FilesMatch> </IfModule>
2、Nginx 在nginx.conf 內(nèi)部加上
location ~* \.(eot|ttf|woff|svg|otf|woff2)$ { add_header Access-Control-Allow-Origin *; }
3、如果用了CDN的話,需要配置HTTP頭
文檔最后更新時(shí)間:2018-11-27 04:33:07