Skip to content

Commit dccdadd

Browse files
committed
* 开放所有的请求都需要进行验证管理
1 parent d00bcdf commit dccdadd

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

APIJSONORM/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.github.gouchy</groupId>
77
<artifactId>APIJSON</artifactId>
8-
<version>6.1.0_1</version>
8+
<version>6.1.2</version>
99
<packaging>jar</packaging>
1010

1111
<name>APIJSONORM</name>

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4901,8 +4901,12 @@ else if (userId instanceof Subquery) {}
49014901
//强制作为条件且放在最前面优化性能
49024902
request.remove(idKey);
49034903
request.remove(idInKey);
4904-
request.remove(userIdKey);
4905-
request.remove(userIdInKey);
4904+
/**
4905+
* modify by gouchy chen
4906+
* 不删除相应的字段
4907+
*/
4908+
//request.remove(userIdKey);
4909+
//request.remove(userIdInKey);
49064910
//关键词
49074911
request.remove(KEY_ROLE);
49084912
request.remove(KEY_EXPLAIN);
@@ -5088,11 +5092,11 @@ else if (userId instanceof Subquery) {}
50885092
}
50895093

50905094
if (StringUtil.isNotEmpty(combineExpr, true)) {
5091-
List<String> banKeyList = Arrays.asList(idKey, idInKey, userIdKey, userIdInKey);
5095+
List<String> banKeyList = Arrays.asList(idKey, idInKey);
50925096
for (String key : banKeyList) {
50935097
if(keyInCombineExpr(combineExpr, key)) {
50945098
throw new UnsupportedOperationException(table + ":{} 里的 @combine:value 中的 value 里 " + key + " 不合法!"
5095-
+ "不允许传 [" + idKey + ", " + idInKey + ", " + userIdKey + ", " + userIdInKey + "] 其中任何一个!");
5099+
+ "不允许传 [" + idKey + ", " + idInKey + "] 其中任何一个!");
50965100
}
50975101
}
50985102
}
@@ -5128,9 +5132,9 @@ else if (w.startsWith("!")) {
51285132
throw new IllegalArgumentException(table + ":{} 里的 @combine:value 中的value里条件 " + ws[i] + " 不合法!不允许为空值!");
51295133
}
51305134
else {
5131-
if (idKey.equals(w) || idInKey.equals(w) || userIdKey.equals(w) || userIdInKey.equals(w)) {
5135+
if (idKey.equals(w) || idInKey.equals(w)) {
51325136
throw new UnsupportedOperationException(table + ":{} 里的 @combine:value 中的 value 里 " + ws[i] + " 不合法!"
5133-
+ "不允许传 [" + idKey + ", " + idInKey + ", " + userIdKey + ", " + userIdInKey + "] 其中任何一个!");
5137+
+ "不允许传 [" + idKey + ", " + idInKey + "] 其中任何一个!");
51345138
}
51355139
}
51365140

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public JSONObject execute(@NotNull SQLConfig config, boolean unknownType) throws
240240
}
241241

242242
if (updateCount <= 0) {
243-
throw new IllegalAccessException("没权限访问或对象不存在!"); // NotExistException 会被 catch 转为成功状态
243+
throw new IllegalAccessException("无法获取到对象或者对象数据未更改!"); // NotExistException 会被 catch 转为成功状态
244244
}
245245

246246
// updateCount>0时收集结果。例如更新操作成功时,返回count(affected rows)、id字段

0 commit comments

Comments
 (0)