{
"lang": [],
"modules": [
{
"id": "user_table",
"entity": {
"id": {
"visible": true,
"createable": true,
"type": "int(11)"
},
"name": {
"visible": true,
"createable": true,
"type": "varchar(255)"
},
"sex": {
"visible": true,
"createable": true,
"type": "varchar(255)"
}
}
}
]
}
这个json格式都是自己构造的,为了避免重复添加modules中的内容,需要在构造时判断"id":"user_table"是否已经存在。
花了一晚上时间,最后发现就一句代码。
ConfigStore.Core["modules"].ToString().Contains("id");
其中的ConfigStore.Core是结合了自己的代码。先取出modules,然后使用Contains()判断一下就好了。