@@ -35,15 +35,12 @@ public bool IsTable(string table)
35
35
/// <returns></returns>
36
36
public bool IsCol ( string table , string col )
37
37
{
38
- return db . Db . DbMaintenance . GetColumnInfosByTableName ( table ) . Any ( it => it . DbColumnName . Equals ( table , StringComparison . CurrentCultureIgnoreCase ) ) ;
38
+ return db . Db . DbMaintenance . GetColumnInfosByTableName ( table ) . Any ( it => it . DbColumnName . Equals ( col , StringComparison . CurrentCultureIgnoreCase ) ) ;
39
39
}
40
40
41
41
public ( dynamic , int ) GetTableData ( string subtable , int page , int count , string json , JObject dd )
42
42
{
43
- if ( ! IsTable ( subtable ) )
44
- {
45
- throw new Exception ( $ "表名{ subtable } 不正确!") ;
46
- }
43
+
47
44
var role = _identitySvc . GetSelectRole ( subtable ) ;
48
45
if ( ! role . Item1 ) //没有权限返回异常
49
46
{
@@ -70,10 +67,7 @@ public bool IsCol(string table, string col)
70
67
}
71
68
public dynamic GetFirstData ( string subtable , string json , JObject dd )
72
69
{
73
- if ( IsTable ( subtable ) )
74
- {
75
- throw new Exception ( $ "表名{ subtable } 不正确!") ;
76
- }
70
+
77
71
var role = _identitySvc . GetSelectRole ( subtable ) ;
78
72
if ( ! role . Item1 ) //没有权限返回异常
79
73
{
@@ -90,6 +84,10 @@ public dynamic GetFirstData(string subtable, string json, JObject dd)
90
84
}
91
85
private ISugarQueryable < System . Dynamic . ExpandoObject > sugarQueryable ( string subtable , string selectrole , JObject values , JObject dd )
92
86
{
87
+ if ( ! IsTable ( subtable ) )
88
+ {
89
+ throw new Exception ( $ "表名{ subtable } 不正确!") ;
90
+ }
93
91
var tb = db . Db . Queryable ( subtable , "tb" ) ;
94
92
if ( values [ "@column" ] . IsValue ( ) )
95
93
{
0 commit comments