From 347509eaecd38ef93ad34a578f7067c4b5f661d4 Mon Sep 17 00:00:00 2001 From: yya <654284087@qq.com> Date: Thu, 29 Nov 2018 18:51:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BF=AE=E6=94=B9=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APIJSON.NET/APIJSON.NET/Controllers/JsonController.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/APIJSON.NET/APIJSON.NET/Controllers/JsonController.cs b/APIJSON.NET/APIJSON.NET/Controllers/JsonController.cs index 4f11e5a..7a0592b 100644 --- a/APIJSON.NET/APIJSON.NET/Controllers/JsonController.cs +++ b/APIJSON.NET/APIJSON.NET/Controllers/JsonController.cs @@ -251,15 +251,14 @@ public ActionResult Edit([FromBody]string json) } var dt = new Dictionary(); - dt.Add("id", value["id"].ToString()); foreach (var f in value) { - if (f.Key.ToLower() != "id"&& selectTable.IsCol(key,f.Key) && (role.Update.Column.Contains ("*")||role.Update.Column.Contains(f.Key, StringComparer.CurrentCultureIgnoreCase))) + if (f.Key.ToLower() != "id" && selectTable.IsCol(key, f.Key) && (role.Update.Column.Contains("*") || role.Update.Column.Contains(f.Key, StringComparer.CurrentCultureIgnoreCase))) { dt.Add(f.Key, f.Value); } } - db.Db.Updateable(dt).AS(key).ExecuteCommand(); + db.Db.Updateable(dt).AS(key).Where("id=@id", new { id = value["id"].ToString() }).ExecuteCommand(); ht.Add(key, JToken.FromObject(new { code = 200, msg = "success", id = value["id"].ToString() })); } }