日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

springboot : Failed to decode downloaded font 和 OTS parsing error

發布時間:2023/12/10 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 springboot : Failed to decode downloaded font 和 OTS parsing error 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

大家好,我是烤鴨:

采坑實錄,看了很多人跟我有類似問題,但是都沒解決我的問題:

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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。