Skip to content

Commit

Permalink
Disable redirect https
Browse files Browse the repository at this point in the history
  • Loading branch information
lixinyang123 committed Jan 11, 2023
1 parent 76d2bda commit cc93fb1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 25 deletions.
6 changes: 3 additions & 3 deletions CoreHome.Admin/Controllers/OverviewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ public async Task<IActionResult> 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]
Expand Down
6 changes: 0 additions & 6 deletions CoreHome.Admin/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 6 additions & 6 deletions CoreHome.Admin/wwwroot/js/home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
5 changes: 1 addition & 4 deletions CoreHome.Admin/wwwroot/js/overview/ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
};
};

Expand Down
6 changes: 0 additions & 6 deletions CoreHome.HomePage/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit cc93fb1

Please sign in to comment.