@@ -787,7 +787,7 @@ public JSONArray onArrayParse(JSONObject request, String parentPath, String name
787
787
}
788
788
789
789
//不能允许GETS,否则会被通过"[]":{"@role":"ADMIN"},"Table":{},"tag":"Table"绕过权限并能批量查询
790
- if (RequestMethod .isGetMethod (requestMethod , false ) == false ) {
790
+ if (isSubquery == false && RequestMethod .isGetMethod (requestMethod , false ) == false ) {
791
791
throw new UnsupportedOperationException ("key[]:{}只支持GET方法!不允许传 " + name + ":{} !" );
792
792
}
793
793
if (request == null || request .isEmpty ()) {//jsonKey-jsonValue条件
@@ -855,7 +855,7 @@ public JSONArray onArrayParse(JSONObject request, String parentPath, String name
855
855
856
856
857
857
//key[]:{Table:{}}中key equals Table时 提取Table
858
- int index = name == null ? -1 : name .lastIndexOf ("[]" );
858
+ int index = isSubquery || name == null ? -1 : name .lastIndexOf ("[]" );
859
859
String childPath = index <= 0 ? null : Pair .parseEntry (name .substring (0 , index ), true ).getKey (); // Table-key1-key2...
860
860
861
861
//判断第一个key,即Table是否存在,如果存在就提取
@@ -877,7 +877,7 @@ public JSONArray onArrayParse(JSONObject request, String parentPath, String name
877
877
JSONObject parent ;
878
878
//生成size个
879
879
for (int i = 0 ; i < (isSubquery ? 1 : size ); i ++) {
880
- parent = onObjectParse (request , path , "" + i , config .setType (SQLConfig .TYPE_ITEM ).setPosition (i ), isSubquery );
880
+ parent = onObjectParse (request , isSubquery ? parentPath : path , isSubquery ? name : "" + i , config .setType (SQLConfig .TYPE_ITEM ).setPosition (i ), isSubquery );
881
881
if (parent == null || parent .isEmpty ()) {
882
882
break ;
883
883
}
0 commit comments