项目中心的扩展属性为空,接口返回:config.applyTo is not an Arr
更新时间: 2026-01-14 16:05:17
阅读 11
项目中心的扩展属性为空,接口返回:config.applyTo is not an Arr

原因:用户的某个扩展属性的可选范围列表值过多导致的,业务库中记录的字段结果被截断导致异常
解决方案:
1.修改业务库,将超出长度的扩展属性进行删减并补充数据
2.进入业务库,查询select * from youdata.report_attribute where project_id=xxx 对应项目 \G;
查看具体是哪条数据中的config字段内容过长并且缺失数据
正确的config结构应该是:
扩展属性的可选范围是列表时:
{"defaultValue":"1","allowType":"list","list":["1","2","3"],"applyTo":["NEW_REPORT"]}扩展属性的可选范围是任意时:
{"defaultValue":"1jisdnfisdhfi姜丽说当减肥了的设计费","allowType":"any","applyTo":["NEW_REPORT"]}错误的config:
{"defaultValue":"1","allowType":"list","list":["??????","??????","??????","??????","??????","??????","??????","??????","??????","??????","??????","??????","??????","??????","??????"3.找到对应的数据后,查看对应数据的id

4.执行sql
update youdata.report_attribute set config = '{\"defaultValue\":\"1\",\"allowType\":\"list\",\"list\":[\"??????\",\"??????\",\"??????\",\"??????\",\"??????\",\"??????\",\"??????\",\"??????\",\"??????\",\"??????\",\"??????\",\"??????\",\"??????\",\"??????\",\"??????\"],\"applyTo\":[\"NEW_REPORT\"]}' where project_id = xxx 对应项目 and id = 刚才查出的对应的id;
5.回车后,再去执行以下查询sql看一下对应的id的config是否修改正确
select * from youdata.report_attribute where project_id=xxx 对应项目 and id =id = 刚才查出的对应的id;6.确认无误后,返回有数前端查看前端是否恢复正常即可
文档反馈
以上内容对您是否有帮助?