问题描述:
前端传参的时候,某个参数中是富文本格式,格式如下:
{ "id": "698002e34cb64156ade62a073699f5d9",
"apiName": "基本信息测试",
"code": "ONLINE-CYCZGJ-202302110936",
"reqParam": "<table><tbody><tr><td><p>参数英文名</p></td><td><p>参数中文名称</p></td><td><p>参数是否必填</p></td><td><p>参数值是否可空</p></td></tr><tr><td><p>idCardNo</p></td><td><p></p></td><td><p>false</p></td><td><p></p></td></tr></tbody></table>"
}
reqParam这个参数传递到后台之后,接收的数据变为: 参数英文名参数中文名称参数是否必填参数值是否可空,其中的<table><toboy><tr><td><p>等标签全部丢失
问题定位:
拦截攻击问题,默认会把字符串中含有代码的标签过滤
解决办法:
#xss配置,防止xss攻击
xss:
#过滤开关
enabled: false
#排除链接(多个用逗号分隔)
excludes: /dataservice/apiserviceregister/save
#匹配链接
urlPatterns: /dataservice/*