大家好,我是烤鸭:

采坑实录,看了很多人跟我有类似问题,但是都没解决我的问题:

Failed to decode downloaded font 和 OTS parsing error:

尝试了把woff文件移动到其他可以加载的静态资源文件夹下,还是无法加载。

浏览器打开访问直接跳转到登录页。猜测是字体的静态资源被拦截。

解答参考这个:

https://stackoverflow.com/questions/34037051/spring-boot-font-awesome-ots-parsing-error-failed-to-convert

pom上加 <exclude> 和 <include>

如图

pom上加 <nonFilteredFileExtensions>

如图

如果上面的方法都解决不了你的问题的话!!!

去看看项目里边用没用shiro。加上了woff的过滤,好了。

@Bean(name="shiroFilter")public ShiroFilterFactoryBean shiroFilter(@Qualifier("securityManager") SecurityManager manager) {ShiroFilterFactoryBean bean=new ShiroFilterFactoryBean();bean.setSecurityManager(manager);//配置登录的url和登录成功的urlbean.setLoginUrl("/login.html");bean.setSuccessUrl("/index.html");//配置访问权限LinkedHashMap<String, String> filterChainDefinitionMap=new LinkedHashMap<>();//anon表示可以匿名访问  authc表示需要认证才可以访问filterChainDefinitionMap.put("/sys/login", "anon");filterChainDefinitionMap.put("/**/*.mp4", "anon");filterChainDefinitionMap.put("/**/*.css", "anon");filterChainDefinitionMap.put("/**/*.js", "anon");filterChainDefinitionMap.put("/**/login.html", "anon");filterChainDefinitionMap.put("/**/fonts/**", "anon");filterChainDefinitionMap.put("/**/*.woff", "anon");filterChainDefinitionMap.put("/**/plugins/**", "anon");filterChainDefinitionMap.put("/swagger/**", "anon");filterChainDefinitionMap.put("/favicon.ico", "anon");filterChainDefinitionMap.put("/captcha.jpg", "anon");filterChainDefinitionMap.put("/", "anon");filterChainDefinitionMap.put("/**", "authc");bean.setFilterChainDefinitionMap(filterChainDefinitionMap);return bean;}

最后:

虽然一开始判断的对了,但是把shiro这个忘记了,自己导致后来加了过滤器和拦截器

配置放行静态资源,都无效,就有点着急了。记录一下,如果有类似的朋友,省点时间,干点啥不好。

springboot : Failed to decode downloaded font 和 OTS parsing error相关推荐

  1. Spring Boot + Bootstrap 出现Failed to decode downloaded font和OTS parsing error: Failed to convert W

    转载自:https://www.cnblogs.com/tomcatandjerry/p/5799188.html 准确来讲,应该是maven项目使用Bootstrap时,出现 "Faile ...

  2. Failed to decode downloaded font(线上环境字体图标不显示)

    1.问题:maven项目使用Bootstrap时,出现 "Failed to decode downloaded font"和"OTS parsing error: Fa ...

  3. Springboot项目引入Bootstrap后,图标不能正常显示,报:Failed to decode downloaded font

    springboot项目引入bootstrap后,报:Failed to decode downloaded font,图标不能正常显示 在pom文件中,添加如下配置 <plugin>&l ...

  4. Failed to decode downloaded font

    小Z上周五晚上和同事加班,同事反映了这样一个BUG. 网页上有一段文本需要采用方正超粗黑简体的字体,资源文件为"方正超粗黑简体.TTF",为美工提供.同事反映网站浏览器提示&quo ...

  5. Failed to decode downloaded font: URL 问题的两种可能性

    问题:18Failed to decode downloaded font: <URL> 1.先找了百度,都是这样的 比如这个:https://blog.csdn.net/wochunya ...

  6. Spring Boot - Font Awesome OTS parsing error: Failed to convert( Failed to decode downloaded font)

    解决方法: 14 down vote accepted The issue is that Maven was filtering the font files and corrupting them ...

  7. Failed to decode downloaded font:解决方法

    我用的是SpringBoot+layUi写的出现 方法一 发现乱码网上说写拦截器什么的, 下载链接把文件中fonts文件下的替换成我的 链接:https://pan.baidu.com/s/1u3aG ...

  8. 解决springboot报错:OTS parsing error: incorrect file size in WOFF header

    错误问题: 谷歌浏览器 console 中报警告信息: Failed to decode downloaded font: /font/element-icons.woff OTS parsing e ...

  9. OTS parsing error: invalid version tag woff和ttf文件被Filter拦截

    从服务器下载的字体文件放在本地,执行无法展示iconfont,浏览器控制台报出 Failed to decode downloaded font: http://127.0.0.1:8080/mhr/ ...

最新文章

  1. 拦截器和过滤器之间有很多相同之处,但是两者之间存在根本的差别
  2. crontab 每5分钟_Crontab安装步骤和命令使用详细解说
  3. java学习(141):自定义捕捉异常
  4. mysql建立从库同时备份_mysql主从库配置读写分离以及备份
  5. matlab m文件的编写,Matlab实验报告(四)M文件的编写.doc
  6. HTTP之长连接与短连接(C++ Qt框架实现)
  7. 【selenium 小练手 抓取某大厂TP】
  8. 什么人不在生死簿_地府在孙悟空划掉生死簿以后,因为什么原因不组织重写?...
  9. java lambda map用法_Java 中如何使用 lambda 表达式填充 Map?
  10. Java23中设计模式(Design Patterns)详解
  11. VB.NET工作笔记004---认识wsf文件
  12. mql 查询多结果_MQL入门到精通EA教程第六课MQL语言基础(五)
  13. 局域网计算机不能共享常见问题
  14. QTP自动化测试最佳实践
  15. win7笔记本外接显示器html,win7系统笔记本怎样外接一个显示器
  16. KVM 多电脑切换器(KVM Switch)
  17. 机器学习基石 5.3 Effective Number of Hypotheses
  18. layui 如何取得select下拉框选中的值
  19. 详解C盘Windows文件夹里重要文件的作用
  20. ORM是什么? ORM框架是什么?

热门文章

  1. [html] 百度、淘宝、京东移动端首页秒开是如何做到的?
  2. [js] 写一个 document.querySelector 的逆方法
  3. [vue] 在使用计算属性的时,函数名和data数据源中的数据可以同名吗?
  4. 前端学习(2754):配置tabber
  5. “约见”面试官系列之常见面试题第二十六篇之vue-router的hash和history(建议收藏)
  6. 前端学习(1978)vue之电商管理系统电商系统之为每一行数据提供单独的value
  7. 前端学习(1488):jsonp回顾
  8. 前端学习(765):使用构造函数的原因
  9. 树莓派Raspberry 操作GPIO--LED
  10. 阿里云设置域名解析到主机ip