Пример #1
0
 private static string ReplaceHtml(string html)
 {
     if (WebHelper.IsUseUISite)
     {
         string ui = AppConfig.GetApp("UI", string.Empty).ToLower();
         if (!string.IsNullOrEmpty(ui))
         {
             html = html.Replace(" src=\"/", " src=\"" + ui + "/").Replace(" src = \"/", " src = \"" + ui + "/").Replace(" src = '/", " src = '/" + ui + "/").Replace(" src='/", " src ='/" + ui + "/");;
             html = html.Replace(" href=\"/", " href=\"" + ui + "/").Replace(" href = \"/", " href = \"" + ui + "/").Replace(" href='/", " href='" + ui + "/").Replace(" href = '/", " href = '" + ui + "/");
         }
     }
     //替换标签
     if (html.IndexOf("${") > -1)
     {
         html = LangConst.ReplateHtmlLanguage(html);
     }
     return(html);
 }
Пример #2
0
 private static string ReplaceHtml(string html)
 {
     if (html.IndexOf("<meta name=\"Referrer\"") == -1)//safari浏览器的引用不完整。
     {
         html = html.Replace("</head>", "    <meta name=\"Referrer\" content=\"always\" />\n</head>");
     }
     if (WebHelper.IsUseUISite)
     {
         string ui = AppConfig.GetApp("UI", string.Empty).ToLower();
         if (!string.IsNullOrEmpty(ui))
         {
             html = html.Replace(" src=\"/", " src=\"" + ui + "/").Replace(" src = \"/", " src = \"" + ui + "/").Replace(" src = '/", " src = '/" + ui + "/").Replace(" src='/", " src ='/" + ui + "/");;
             html = html.Replace(" href=\"/", " href=\"" + ui + "/").Replace(" href = \"/", " href = \"" + ui + "/").Replace(" href='/", " href='" + ui + "/").Replace(" href = '/", " href = '" + ui + "/");
         }
     }
     //替换标签
     if (html.IndexOf("${") > -1)
     {
         html = LangConst.ReplateHtmlLanguage(html);
     }
     return(html);
 }