过滤配置项中id为0的项
This commit is contained in:
parent
eb085651d0
commit
4b6e5bdcb2
@ -16,6 +16,10 @@ export var DataParser = (function (){
|
|||||||
let dict = new Map();
|
let dict = new Map();
|
||||||
for (let i = 0, len = data.length; i < len; i++) {
|
for (let i = 0, len = data.length; i < len; i++) {
|
||||||
let obj = data[i];
|
let obj = data[i];
|
||||||
|
if (!obj[idkey]) {
|
||||||
|
console.error(`配置${key}的数据有误,唯一标识 ${idkey} 值为0或者没有${idkey}`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let to = new CfgCreator();
|
let to = new CfgCreator();
|
||||||
to.decode(obj);
|
to.decode(obj);
|
||||||
if (dict.has(to.id)) {
|
if (dict.has(to.id)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user