原因分析
如果你的前端打包资源放置在了诸如 sprint boot 的后端项目中,可以看看是不是后端的项目把你的 woff 的字体图标文件进行了转义,导致浏览器解析失败。
解决方案
在maven文件的pom文件的build标签加入下面的
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
<nonFilteredFileExtension>woff</nonFilteredFileExtension>
<nonFilteredFileExtension>woff2</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>