From f5c3177531fa8bcdb9fb81c0a9c79d392ea8683c Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Sun, 13 May 2018 18:38:17 +0800 Subject: [PATCH] =?UTF-8?q?Server:=E8=A7=A3=E5=86=B3head=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=9C=A8@column=E6=A0=A1=E9=AA=8C=E6=9C=AA=E5=8A=A0isPrepared?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=EF=BC=8C=E4=BB=A5=E5=8F=8A=E6=9C=89=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E5=AD=97=E6=AE=B5=E6=97=B6=E5=87=BA=E7=8E=B0=E7=9A=84?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/zuo/biao/apijson/server/AbstractSQLConfig.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/APIJSON-Java-Server/APIJSONLibrary/src/main/java/zuo/biao/apijson/server/AbstractSQLConfig.java b/APIJSON-Java-Server/APIJSONLibrary/src/main/java/zuo/biao/apijson/server/AbstractSQLConfig.java index 64216cb58..7bccc1514 100755 --- a/APIJSON-Java-Server/APIJSONLibrary/src/main/java/zuo/biao/apijson/server/AbstractSQLConfig.java +++ b/APIJSON-Java-Server/APIJSONLibrary/src/main/java/zuo/biao/apijson/server/AbstractSQLConfig.java @@ -348,9 +348,10 @@ public AbstractSQLConfig setColumn(String column) { public String getColumnString() throws NotExistException { switch (getMethod()) { case HEAD: - case HEADS: - if (StringUtil.isEmpty(column, true) == false && StringUtil.isName(column) == false) { - throw new IllegalArgumentException("HEAD请求: @column:value 中 value必须是1个单词!"); + case HEADS: //StringUtil.isEmpty(column, true) || column.contains(",") 时SQL.count(column)会return "*" + if (isPrepared() && StringUtil.isEmpty(column, true) == false + && column.contains(",") == false && StringUtil.isName(column) == false) { + throw new IllegalArgumentException("HEAD请求: @column:value 中 value里面用 , 分割的每一项都必须是1个单词!"); } return SQL.count(column); case POST: