本文作者:DurkBlue

使用若依框架结合security在保存含有富文本数据时出现Unexpected character ('/' (code 47)): maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser); 推荐

使用若依框架结合security在保存含有富文本数据时出现Unexpected character ('/' (code 47)): maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser); 摘要: 最近在使用若依框架做项目时,遇见了一个问题:在添加页面中引入了富文本,然后在富文本中添加图片在保存时就会出现下列错误:Unexpected character ('/...

最近在使用若依框架做项目时,遇见了一个问题:在添加页面中引入了富文本,然后在富文本中添加图片在保存时就会出现下列错误:


Unexpected character ('/' (code 47)): maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser); nested exception is com.fasterxml.jackson.core

.JsonParseException: Unexpected character ('/' (code 47)): m


使用若依框架结合security在保存含有富文本数据时出现Unexpected character ('/' (code 47)): maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser); 第1张


针对出现的这个问题,在网上找到两个解决方案,一下就是具体的解决方案。


一、更改网关模块的配置文件。


更改网关模块的配置文件是最直接也是最不安全的做法,情况紧急的情况下可以暂时使用。打开网关配置文件  gateway-dev.yml,然后找到  security  安全配置下的  xss 防止XSS攻击的 excludeUrls:  


然后把添加数据的接口路径配置上去。如图:

使用若依框架结合security在保存含有富文本数据时出现Unexpected character ('/' (code 47)): maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser); 第2张


配置完成之后,重启网关模块即可。



此篇文章由DurkBlue发布,麻烦转载请注明来处
文章投稿或转载声明

来源:DurkBlue版权归原作者所有,转载请保留出处。本站文章发布于 2023-11-22
温馨提示:文章内容系作者个人观点,不代表DurkBlue博客对其观点赞同或支持。

赞(0)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

阅读
分享

发表评论取消回复

快捷回复:
AddoilApplauseBadlaughBombCoffeeFabulousFacepalmFecesFrownHeyhaInsidiousKeepFightingNoProbPigHeadShockedSinistersmileSlapSocialSweatTolaughWatermelonWittyWowYeahYellowdog

评论列表 (暂无评论,325人围观)参与讨论

还没有评论,来说两句吧...