From d0f05328a2320d5f4ec967d22deea4d7bb38889f Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 27 Feb 2026 09:39:57 +0000 Subject: [PATCH] fix(ux): landing page + login selector fully working MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Landing Page at /home renders correctly (GoodGo POS branding) - Server middleware redirects / → /home (302) - Login Type Selector at /login with 4 role cards - All navbar links point to /login - Simplified Home.razor (removed @layout override that caused routing issue) - Fixed /auth/login route conflict Co-authored-by: Velik --- .../Layout/AuthLayout.razor | 2 +- .../Layout/MainLayout.razor | 4 +- .../Pages/Auth/LoginSelect.razor | 3 +- .../src/WebClientTpos.Client/Pages/Home.razor | 86 +++---------------- .../src/WebClientTpos.Server/Program.cs | 14 +++ 5 files changed, 29 insertions(+), 80 deletions(-) diff --git a/apps/web-client-tpos-net/src/WebClientTpos.Client/Layout/AuthLayout.razor b/apps/web-client-tpos-net/src/WebClientTpos.Client/Layout/AuthLayout.razor index e581d80a..77fac367 100644 --- a/apps/web-client-tpos-net/src/WebClientTpos.Client/Layout/AuthLayout.razor +++ b/apps/web-client-tpos-net/src/WebClientTpos.Client/Layout/AuthLayout.razor @@ -12,7 +12,7 @@ diff --git a/apps/web-client-tpos-net/src/WebClientTpos.Client/Layout/MainLayout.razor b/apps/web-client-tpos-net/src/WebClientTpos.Client/Layout/MainLayout.razor index 0ceee7b2..41164c4d 100644 --- a/apps/web-client-tpos-net/src/WebClientTpos.Client/Layout/MainLayout.razor +++ b/apps/web-client-tpos-net/src/WebClientTpos.Client/Layout/MainLayout.razor @@ -21,7 +21,7 @@ - @L["Nav_Login"] + @L["Nav_Login"] @L["Nav_FreeTrial"] @@ -44,7 +44,7 @@ @L["Nav_Features"] @L["Nav_Pricing"] @L["Nav_Contact"] - @L["Nav_Login"] + @L["Nav_Login"]
@L["Nav_FreeTrial"] diff --git a/apps/web-client-tpos-net/src/WebClientTpos.Client/Pages/Auth/LoginSelect.razor b/apps/web-client-tpos-net/src/WebClientTpos.Client/Pages/Auth/LoginSelect.razor index ab00d463..7694fe4e 100644 --- a/apps/web-client-tpos-net/src/WebClientTpos.Client/Pages/Auth/LoginSelect.razor +++ b/apps/web-client-tpos-net/src/WebClientTpos.Client/Pages/Auth/LoginSelect.razor @@ -1,5 +1,6 @@ @page "/auth/login" -@layout AuthLayout +@page "/login" +@layout MainLayout @inject NavigationManager Navigation @inject IJSRuntime JS diff --git a/apps/web-client-tpos-net/src/WebClientTpos.Client/Pages/Home.razor b/apps/web-client-tpos-net/src/WebClientTpos.Client/Pages/Home.razor index 00de7347..8a1529df 100644 --- a/apps/web-client-tpos-net/src/WebClientTpos.Client/Pages/Home.razor +++ b/apps/web-client-tpos-net/src/WebClientTpos.Client/Pages/Home.razor @@ -1,80 +1,14 @@ +@page "/home" @page "/" -@layout AuthLayout -@inject NavigationManager Navigation -@inject IJSRuntime JS -GoodGo POS — Hệ thống quản lý POS đa ngành +GoodGo POS - -
- -

- GoodGo POS -

- -

- Hệ thống quản lý POS đa ngành -

- -

- Giải pháp toàn diện cho Café, Nhà hàng, Karaoke, Spa & Bán lẻ -

- -
- - +
+

GoodGo POS

+

Hệ thống quản lý POS đa ngành

+

Café · Nhà hàng · Karaoke · Spa · Bán lẻ

+ -
- - -
-
- - @foreach (var card in _featureCards) - { -
- -

@card.Title

-

@card.Description

-
- } - -
-
- - - - -@code { - protected override async Task OnAfterRenderAsync(bool firstRender) - { - if (firstRender) - { - try { await JS.InvokeVoidAsync("lucide.createIcons"); } catch { } - } - } - - private record FeatureCard(string Icon, string Title, string Description); - - private readonly FeatureCard[] _featureCards = - [ - new("coffee", "Café & Bar", "Quản lý đơn hàng, pha chế, loyalty"), - new("utensils", "Nhà hàng", "Sơ đồ bàn, bếp, đặt bàn"), - new("mic", "Karaoke", "Quản lý phòng, timer, F&B"), - new("sparkles", "Spa & Beauty", "Lịch hẹn, dịch vụ, therapist"), - ]; -} +
diff --git a/apps/web-client-tpos-net/src/WebClientTpos.Server/Program.cs b/apps/web-client-tpos-net/src/WebClientTpos.Server/Program.cs index 9b8c3c03..79cb0226 100644 --- a/apps/web-client-tpos-net/src/WebClientTpos.Server/Program.cs +++ b/apps/web-client-tpos-net/src/WebClientTpos.Server/Program.cs @@ -61,6 +61,20 @@ if (app.Environment.IsDevelopment()) app.UseHttpsRedirection(); +// EN: Redirect exact root "/" to "/home" before Blazor SPA catches it +// VI: Redirect chính xác "/" về "/home" trước khi Blazor SPA xử lý +app.Use(async (context, next) => +{ + if (context.Request.Path == "/" && context.Request.Method == "GET" + && !context.Request.Path.StartsWithSegments("/api") + && !context.Request.Headers.Accept.ToString().Contains("application/json")) + { + context.Response.Redirect("/home"); + return; + } + await next(); +}); + // EN: Enable CORS // VI: Kích hoạt CORS app.UseCors("BlazorClient");