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