对象数组去掉相同属性值的项
const allArr = []
const oldArr = payload.data
for (let i = 0; i < oldArr.length; i += 1) {
let flag = true
for (let j = 0; j < allArr.length; j += 1) {
if (oldArr[i].code === allArr[j].code) {
flag = false
}
}
if (flag) {
allArr.push(oldArr[i])
}
}