From ece04bb3d358cd6c638dfbd0f750ff80bb770225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Thu, 17 Nov 2022 10:47:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=89=8D=E7=AB=AF=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E8=BF=94=E5=9B=9E=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Model/System/UserConstants.cs | 4 ++++ ZR.Model/System/Vo/RouterVo.cs | 11 ++++------- ZR.Service/System/SysMenuService.cs | 6 +++++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ZR.Model/System/UserConstants.cs b/ZR.Model/System/UserConstants.cs index 8751269..7914ab2 100644 --- a/ZR.Model/System/UserConstants.cs +++ b/ZR.Model/System/UserConstants.cs @@ -71,5 +71,9 @@ namespace ZR.Model.System /// https请求 /// public static string HTTPS = "https://"; + /// + /// www主域 + /// + public static string WWW = "www."; } } diff --git a/ZR.Model/System/Vo/RouterVo.cs b/ZR.Model/System/Vo/RouterVo.cs index b48fa2f..30f982c 100644 --- a/ZR.Model/System/Vo/RouterVo.cs +++ b/ZR.Model/System/Vo/RouterVo.cs @@ -52,19 +52,16 @@ namespace ZR.Model.System.Vo Icon = icon; Link = path; } - public Meta(string title, string icon, bool noCache) - { - Title = title; - Icon = icon; - NoCache = noCache; - } public Meta(string title, string icon, bool noCache, string titleKey, string path) { Title = title; Icon = icon; NoCache = noCache; TitleKey = titleKey; - Link = path; + if (!string.IsNullOrEmpty(path) && (path.StartsWith(UserConstants.HTTP) || path.StartsWith(UserConstants.HTTPS))) + { + Link = path; + } } } } diff --git a/ZR.Service/System/SysMenuService.cs b/ZR.Service/System/SysMenuService.cs index 68ede52..ca28efc 100644 --- a/ZR.Service/System/SysMenuService.cs +++ b/ZR.Service/System/SysMenuService.cs @@ -549,7 +549,11 @@ namespace ZR.Service /// < returns > public string InnerLinkReplaceEach(string path) { - return path.IsNotEmpty() ? path.Replace(UserConstants.HTTP, "").Replace(UserConstants.HTTPS, "") : path; + return path.IsNotEmpty() ? path + .Replace(UserConstants.HTTP, "") + .Replace(UserConstants.HTTPS, "") + .Replace(UserConstants.WWW, "") + .Replace(".", "/") : path; } #endregion