diff --git a/SAEA.WebRedisManager/Controllers/RedisController.cs b/SAEA.WebRedisManager/Controllers/RedisController.cs index e8b6db1..90d1201 100644 --- a/SAEA.WebRedisManager/Controllers/RedisController.cs +++ b/SAEA.WebRedisManager/Controllers/RedisController.cs @@ -24,29 +24,35 @@ public ActionResult Connect(string name) { try { - var config = ConfigHelper.Get(name); + if (!string.IsNullOrEmpty(name)) + { + name = SAEA.Http.HttpUtility.UrlDecode(name); - var cnnResult = CurrentRedisClient.Connect(config); + var config = ConfigHelper.Get(name); - if (string.Compare(cnnResult, "OK", true) != 0) - { - throw new Exception(cnnResult); - } + var cnnResult = CurrentRedisClient.Connect(config); - var isCluster = CurrentRedisClient.IsCluster(config.Name); + if (string.Compare(cnnResult, "OK", true) != 0) + { + throw new Exception(cnnResult); + } - var data = new List(); + var isCluster = CurrentRedisClient.IsCluster(config.Name); - if (!isCluster) - { - data = CurrentRedisClient.GetDBs(name); - } - else - { - data.Add(0); + var data = new List(); + + if (!isCluster) + { + data = CurrentRedisClient.GetDBs(name); + } + else + { + data.Add(0); + } + return Json(new JsonResult>() { Code = 1, Data = data, Message = "OK" }); } - return Json(new JsonResult>() { Code = 1, Data = data, Message = "OK" }); + return Json(new JsonResult>() { Code = 3, Data = null, Message = "找不到配置~" }); } catch (Exception ex) { @@ -440,15 +446,15 @@ public ActionResult DelItem(RedisData redisData) object data = string.Empty; if (redisData != null) { - redisData.ID = SAEA.Http.Base.HttpUtility.UrlDecode(redisData.ID); + redisData.ID = SAEA.Http.HttpUtility.UrlDecode(redisData.ID); if (!string.IsNullOrEmpty(redisData.Key)) { - redisData.Key = SAEA.Http.Base.HttpUtility.UrlDecode(redisData.Key); + redisData.Key = SAEA.Http.HttpUtility.UrlDecode(redisData.Key); } if (!string.IsNullOrEmpty(redisData.Value)) { - redisData.Value = SAEA.Http.Base.HttpUtility.UrlDecode(redisData.Value); + redisData.Value = SAEA.Http.HttpUtility.UrlDecode(redisData.Value); } CurrentRedisClient.DelItem(redisData); } diff --git a/SAEA.WebRedisManager/Program.cs b/SAEA.WebRedisManager/Program.cs index 647b9a8..0fa41bc 100644 --- a/SAEA.WebRedisManager/Program.cs +++ b/SAEA.WebRedisManager/Program.cs @@ -7,7 +7,7 @@ class Program { static void Main(string[] args) { - ConsoleHelper.Title = "WebRedisManager v5.0.0.2"; + ConsoleHelper.Title = "WebRedisManager v5.1.7.1"; var config = SAEAMvcApplicationConfigBuilder.Read(); diff --git a/SAEA.WebRedisManager/SAEA.WebRedisManager.csproj b/SAEA.WebRedisManager/SAEA.WebRedisManager.csproj index 2ea80f9..391c142 100644 --- a/SAEA.WebRedisManager/SAEA.WebRedisManager.csproj +++ b/SAEA.WebRedisManager/SAEA.WebRedisManager.csproj @@ -230,8 +230,8 @@ - - + + diff --git a/SAEA.WebRedisManager/wwwroot/Content/js/redis.js b/SAEA.WebRedisManager/wwwroot/Content/js/redis.js index b366d48..e3111ae 100644 --- a/SAEA.WebRedisManager/wwwroot/Content/js/redis.js +++ b/SAEA.WebRedisManager/wwwroot/Content/js/redis.js @@ -39,9 +39,9 @@ layerIndex = layer.msg('加载中', { icon: 16 , shade: 0.01 - , time: 30000 + , time: 30000 }); - $.post("/api/redis/connect", "name=" + name, function (dbData) { + $.post("/api/redis/connect?name=" + encodeURI(name), null, function (dbData) { layer.close(layerIndex); if (dbData.Code === 1) { if (dbData.Data !== undefined && dbData.Data.length > 0) { diff --git a/SAEA.WebRedisManager/wwwroot/Index.html b/SAEA.WebRedisManager/wwwroot/Index.html index 60f90eb..a1f3e19 100644 --- a/SAEA.WebRedisManager/wwwroot/Index.html +++ b/SAEA.WebRedisManager/wwwroot/Index.html @@ -21,7 +21,7 @@  WebRedisManager - v5.0.0.2 + v5.1.7.1
    diff --git a/SAEA.WebRedisManagerForNet/SAEA.WebRedisManagerForNet.csproj b/SAEA.WebRedisManagerForNet/SAEA.WebRedisManagerForNet.csproj index e6d959d..e55cd22 100644 --- a/SAEA.WebRedisManagerForNet/SAEA.WebRedisManagerForNet.csproj +++ b/SAEA.WebRedisManagerForNet/SAEA.WebRedisManagerForNet.csproj @@ -80,20 +80,20 @@ ..\packages\protobuf-net.2.4.0\lib\net40\protobuf-net.dll - - ..\packages\SAEA.Common.5.0.0.2\lib\netstandard2.0\SAEA.Common.dll + + ..\packages\SAEA.Common.5.1.6.8\lib\netstandard2.0\SAEA.Common.dll - - ..\packages\SAEA.Http.5.0.0.2\lib\netstandard2.0\SAEA.Http.dll + + ..\packages\SAEA.Http.5.1.7.1\lib\netstandard2.0\SAEA.Http.dll - - ..\packages\SAEA.MVC.5.0.0.2\lib\netstandard2.0\SAEA.MVC.dll + + ..\packages\SAEA.MVC.5.1.7.1\lib\netstandard2.0\SAEA.MVC.dll - - ..\packages\SAEA.RedisSocket.5.0.0.2\lib\netstandard2.0\SAEA.RedisSocket.dll + + ..\packages\SAEA.RedisSocket.5.1.6.8\lib\netstandard2.0\SAEA.RedisSocket.dll - - ..\packages\SAEA.Sockets.5.0.0.2\lib\netstandard2.0\SAEA.Sockets.dll + + ..\packages\SAEA.Sockets.5.1.6.8\lib\netstandard2.0\SAEA.Sockets.dll diff --git a/SAEA.WebRedisManagerForNet/packages.config b/SAEA.WebRedisManagerForNet/packages.config index c3eff95..f27c0b4 100644 --- a/SAEA.WebRedisManagerForNet/packages.config +++ b/SAEA.WebRedisManagerForNet/packages.config @@ -3,11 +3,11 @@ - - - - - + + + + +