zoukankan      html  css  js  c++  java
  • 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等的文件统统删掉,重新下载(亲测有效)

  • 相关阅读:
    linux安装java环境
    前端JS-websocket与后端通信
    windows安装NodeJS/修改全局路径/配置镜像站
    vue基础---13vue-router
    uni-app项目
    vue基础---12脚手架
    vue基础---11组件
    vue基础---10生命周期
    vue基础---09表单输入绑定
    vue基础---08事件
  • 原文地址:https://www.cnblogs.com/liuyp-ken/p/10594458.html
Copyright © 2011-2022 走看看