Skip to content

Commit d66bd2d

Browse files
committed
新增对表、字段不存在的提示
1 parent ed351f6 commit d66bd2d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apijson/CodeUtil.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,8 @@ var CodeUtil = {
764764
}
765765
if (JSONObject.isTableKey(key)) {
766766
var objName = JSONResponse.getSimpleName(key);
767-
return CodeUtil.getComment(CodeUtil.getCommentFromDoc(tableList, objName, null), false, ' ');
767+
var c = CodeUtil.getCommentFromDoc(tableList, objName, null);
768+
return StringUtil.isEmpty(c) ? ' ! 表不存在!' : CodeUtil.getComment(c, false, ' ');
768769
}
769770

770771
return '';
@@ -810,7 +811,8 @@ var CodeUtil = {
810811
}
811812
return '';
812813
}
813-
return CodeUtil.getComment(CodeUtil.getCommentFromDoc(tableList, name, key), false, ' ');
814+
var c = CodeUtil.getCommentFromDoc(tableList, name, key);
815+
return StringUtil.isEmpty(c) ? ' ! 字段不存在!' : CodeUtil.getComment(c, false, ' ');
814816
}
815817

816818
// alert('name = ' + name + '; key = ' + key);

0 commit comments

Comments
 (0)