From 161d538ae3fde8ed64d6e884e977a144ef781c2f Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 11 Sep 2023 11:33:38 +0800 Subject: [PATCH] Add NormalizeUrl --- .../Pages/Account/LoggedOut.cshtml.cs | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs index aca5e2a02c..efa1a7a618 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using NUglify.Helpers; namespace Volo.Abp.Account.Web.Pages.Account; @@ -19,17 +20,26 @@ public class LoggedOutModel : AccountPageModel public virtual Task OnGetAsync() { - PostLogoutRedirectUri = GetRedirectUrl(PostLogoutRedirectUri); - SignOutIframeUrl = GetRedirectUrl(SignOutIframeUrl); - + NormalizeUrl(); return Task.FromResult(Page()); } public virtual Task OnPostAsync() { - PostLogoutRedirectUri = GetRedirectUrl(PostLogoutRedirectUri); - SignOutIframeUrl = GetRedirectUrl(SignOutIframeUrl); - + NormalizeUrl(); return Task.FromResult(Page()); } + + protected virtual void NormalizeUrl() + { + if (!PostLogoutRedirectUri.IsNullOrWhiteSpace()) + { + PostLogoutRedirectUri = Url.Content(GetRedirectUrl(PostLogoutRedirectUri)); + } + + if(!SignOutIframeUrl.IsNullOrWhiteSpace()) + { + SignOutIframeUrl = Url.Content(GetRedirectUrl(SignOutIframeUrl)); + } + } }