>>梦想乡<<

Failed to decode downloaded font

问题描述

项目本来运行的好好的,通过Maven打包后,再次启动运行,发现fontawesome生成的首页的图标不见了。

Firefox检查全程无错误提示,Chrome检查才发现有错误。

报错如下所示:

 

 

解决方案:

1、在Maven的配置文件中增加过滤配置(无效),因为我本来在Maven里面就没有这个配置,另外一个项目基本上一样的,却显示正常。

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
        <resources>
            <!-- fonts file cannot use filter as the data structure of byte file will be changed via filter -->
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <excludes>
                    <exclude>static/fonts/**</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <includes>
                    <include>static/fonts/**</include>
                </includes>
            </resource>
        </resources>
    </build>

2、直接把font目录下的后缀名为oft、woff等的文件统统删掉,重新下载(亲测有效)

 

posted @ 2019-03-25 16:21  文苏  阅读(938)  评论(0编辑  收藏  举报