前端传参时报错:msg: “JSON parse error: Cannot deserialize instance of java.lang.String
out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.lang.String
out of START_ARRAY token\n at [Source: (PushbackInputStream); line: 1, column: 795] (through reference chain: com.ccid.icnj.dto.IcnjEPublicEnterpriseDTO[“cxydjList”]->java.util.ArrayList[0]->com.ccid.icnj.dto.IcnjEPublicCxydjDTO[“industry”])”
看一下传的参数是否有数组
一般是因为传参有数组
然后把数组用 join() 转换成字符串就可以了
var industry = [1034, 103402, 10340202, 1034020202]
industry = industry.join(',')
console.log( industry ) //打印结果:"1034,103402,10340202,1034020202"
好了!