Add NormalizeUrl

pull/17598/head
liangshiwei 1 year ago
parent 1f9a3be325
commit 161d538ae3

@ -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<IActionResult> OnGetAsync()
{
PostLogoutRedirectUri = GetRedirectUrl(PostLogoutRedirectUri);
SignOutIframeUrl = GetRedirectUrl(SignOutIframeUrl);
NormalizeUrl();
return Task.FromResult<IActionResult>(Page());
}
public virtual Task<IActionResult> OnPostAsync()
{
PostLogoutRedirectUri = GetRedirectUrl(PostLogoutRedirectUri);
SignOutIframeUrl = GetRedirectUrl(SignOutIframeUrl);
NormalizeUrl();
return Task.FromResult<IActionResult>(Page());
}
protected virtual void NormalizeUrl()
{
if (!PostLogoutRedirectUri.IsNullOrWhiteSpace())
{
PostLogoutRedirectUri = Url.Content(GetRedirectUrl(PostLogoutRedirectUri));
}
if(!SignOutIframeUrl.IsNullOrWhiteSpace())
{
SignOutIframeUrl = Url.Content(GetRedirectUrl(SignOutIframeUrl));
}
}
}

Loading…
Cancel
Save