问题
css,js文件存储在腾讯云的cos(对象云存储)中,其中font.css有获取同目录下字体、图标等文件的请求。其中部分代码如下。
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 300;
src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url('../fonts/sourcesanspro/sourcesanspro-light.woff') format('woff');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url('../fonts/sourcesanspro/sourcesanspro.woff') format('woff');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url('../fonts/sourcesanspro/sourcesanspro-bold.woff') format('woff');
}
@font-face{font-family:iconfont;src:url(../fonts/iconfont/iconfont.eot?t=1517993881078);src:url(../fonts/iconfont/iconfont.eot?t=1517993881078#iefix) format('embedded-opentype'),url(../fonts/iconfont/iconfont.woff?t=1517993881078) format('woff'),url(../fonts/iconfont/iconfont.ttf?t=1517993881078) format('truetype'),url(../fonts/iconfont/iconfont.svg?t=1517993881078#iconfont) format('svg')}
云存储使用的是自定义的域名,然后到腾讯云CDN配置页面-》高级配置-》HTTP Header配置-》
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Max-Age: 1728000
问题还是没能解决,有时候会报错Access-Control-Allow-Origin为空。还有时候会报错Access-Control-Allow-Origin有两个*。
现在不知道该怎么设置了。求大神帮忙解决一下。