From 2454ea3684e39df0a6430568484be89267dbb855 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 21 Feb 2020 13:14:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Blazor=20=E8=B7=AF=E5=BE=84=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E6=96=B9=E6=B3=95=E6=94=AF=E6=8C=81=20http=20https=20?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bootstrap.Admin/Pages/Extensions/UrlHelperExtensions.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/admin/Bootstrap.Admin/Pages/Extensions/UrlHelperExtensions.cs b/src/admin/Bootstrap.Admin/Pages/Extensions/UrlHelperExtensions.cs index c9d1d519..4f49d67a 100644 --- a/src/admin/Bootstrap.Admin/Pages/Extensions/UrlHelperExtensions.cs +++ b/src/admin/Bootstrap.Admin/Pages/Extensions/UrlHelperExtensions.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Components; @@ -40,6 +41,6 @@ namespace Bootstrap.Admin.Pages.Extensions /// /// /// - public static string ToBlazorLink(this NavigationManager? nav, string url) => $"{nav?.BaseUri}{url.TrimStart('/')}"; + public static string ToBlazorLink(this NavigationManager? nav, string url) => (url.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || url.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) ? url : $"{nav?.BaseUri}{url.TrimStart('/')}"; } }