Skip to content

Commit 07bc899

Browse files
committed
Modified:修复put请求key的bug
1 parent fb437c4 commit 07bc899

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

APIJSONORM/src/main/java/apijson/orm/AbstractObjectParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ else if ((method == POST || method == PUT) && value instanceof JSONArray
261261
&& JSONRequest.isTableArray(key)) { // JSONArray,批量新增或修改,往下一级提取
262262
onTableArrayParse(key, (JSONArray) value);
263263
}
264-
else if (method == PUT && value instanceof JSONArray
265-
&& (whereList == null || whereList.contains(key) == false)) { // PUT JSONArray
264+
else if (method == PUT && value instanceof JSONArray && (whereList == null || whereList.contains(key) == false) && (StringUtil.isName(key) || ((key.endsWith("+") || key.endsWith("-")) && StringUtil.isName(key.substring(0, key.length()-1)))))
265+
{ // PUT JSONArray
266266
onPUTArrayParse(key, (JSONArray) value);
267267
}
268268
else { // JSONArray或其它Object,直接填充

APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3127,7 +3127,7 @@ else if (w.startsWith("!")) {
31273127
}
31283128

31293129
//解决AccessVerifier新增userId没有作为条件,而是作为内容,导致PUT,DELETE出错
3130-
if (isWhere) {
3130+
if (isWhere || (StringUtil.isName(key) == false)) {
31313131
tableWhere.put(key, value);
31323132
if (whereList == null || whereList.contains(key) == false) {
31333133
andList.add(key);

0 commit comments

Comments
 (0)