diff --git a/CoreHome.Admin/Controllers/OverviewController.cs b/CoreHome.Admin/Controllers/OverviewController.cs index 37f3fb88..1fdda1ea 100644 --- a/CoreHome.Admin/Controllers/OverviewController.cs +++ b/CoreHome.Admin/Controllers/OverviewController.cs @@ -48,15 +48,15 @@ public async Task Pushing() { try { - _ = pusher.SendMessage(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffffff") + $"|{i + 1}").GetAwaiter(); + _ = pusher.SendMessage(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + $"|{i + 1}").GetAwaiter(); await Task.Delay(100); } catch { - break; + return NoContent(); } } - return null; + return Ok(); } [NoCache] diff --git a/CoreHome.Admin/Startup.cs b/CoreHome.Admin/Startup.cs index 2f2f42ac..5fe80971 100644 --- a/CoreHome.Admin/Startup.cs +++ b/CoreHome.Admin/Startup.cs @@ -82,12 +82,6 @@ public static void Configure(IApplicationBuilder app, IWebHostEnvironment env) _ = app.UseHsts(); } - //Linux使用Nginx反向代理,不启用https - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - _ = app.UseHttpsRedirection(); - } - _ = app.UsePathBase(new PathString("/Admin")); _ = app.UseWebSockets(); _ = app.UseStaticFiles(); diff --git a/CoreHome.Admin/wwwroot/js/home/index.js b/CoreHome.Admin/wwwroot/js/home/index.js index 381076ea..01da7c13 100644 --- a/CoreHome.Admin/wwwroot/js/home/index.js +++ b/CoreHome.Admin/wwwroot/js/home/index.js @@ -32,19 +32,19 @@ function showTime() { } function changeLoginFunc(index) { - window.localStorage.setItem("SigninFunc", index); + window.localStorage.setItem("LoginFunc", index); } function init() { - let signFunc = localStorage.getItem("SigninFunc"); + let loginFunc = localStorage.getItem("LoginFunc"); - if (isNaN(signFunc)) - signFunc = 0; + if (isNaN(loginFunc)) + loginFunc = 0; - if (!signFunc) + if (!loginFunc) document.querySelector(".carousel-item").className = "carousel-item active"; else - document.querySelectorAll(".carousel-item")[signFunc].className = "carousel-item active"; + document.querySelectorAll(".carousel-item")[loginFunc].className = "carousel-item active"; } init(); \ No newline at end of file diff --git a/CoreHome.Admin/wwwroot/js/overview/ws.js b/CoreHome.Admin/wwwroot/js/overview/ws.js index e1f1a073..1c6ad155 100644 --- a/CoreHome.Admin/wwwroot/js/overview/ws.js +++ b/CoreHome.Admin/wwwroot/js/overview/ws.js @@ -47,11 +47,8 @@ let startWsTest = function () { wschartData.datasets[0].data.push(wslag); window.myWSLine.update(); }; - webSocket.onerror = function (evt) { - alert(evt.message); - }; webSocket.onclose = function () { - $("#spanStatus").text("disconnected"); + $("#spanStatus").text("WebSocket Disconnected"); }; }; diff --git a/CoreHome.HomePage/Startup.cs b/CoreHome.HomePage/Startup.cs index bf4bd1af..805f09eb 100644 --- a/CoreHome.HomePage/Startup.cs +++ b/CoreHome.HomePage/Startup.cs @@ -82,12 +82,6 @@ public static void Configure(IApplicationBuilder app, IWebHostEnvironment env) _ = app.UseHsts(); } - //Linux使用Nginx反向代理,不启用https - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - _ = app.UseHttpsRedirection(); - } - _ = app.UseSession(); _ = app.UseStaticFiles(); _ = app.UseRouting();