做项目的时候遇到这个问题
JSON parse error: Cannot deserialize value of type `com.lqkj.gis.web.cmgis.modules.elasticsearch.domain.SystemType`
from String "": value not one of declared Enum instance names:
[cmphs, cmm7721, cmnet, org, cmmas, cms1719, zhuantitu, map, pubpoi, cmphsStaff, cmvdm, cmvec];
nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type
`com.lqkj.gis.web.cmgis.modules.elasticsearch.domain.SystemType` from String "":
value not one of declared Enum instance names:
[cmphs, cmm7721, cmnet, org, cmmas, cms1719, zhuantitu, map, pubpoi, cmphsStaff, cmvdm, cmvec]
at [Source: (PushbackInputStream); line: 1, column: 39] (through reference chain:
com.lqkj.gis.web.cmgis.modules.elasticsearch.domain.EsSearchTemplate["systemType"])
查询后原因在于数据是枚举类型,不能为空
解决方案:
由于用于请求的数据是个对象,考虑在请求数据的方法中对对象数据进行处理
handleIndex() {
console.log(“进入更新操作”);
var newlistquery = {
page: 0,
pageSize: 10,
systemType : “”,
zoneid : “”,
name : “”
}
this.$set(this, “listQuery”, newlistquery);
delete this.listQuery.systemType; // 对象中删除属性
delete this.listQuery.zoneid;
console.log(“经过处理后的listQuery:”, this.listQuery)
this.getList();
}