修复提示bug

This commit is contained in:
2019-03-20 22:25:43 +08:00
parent 721ec9ce45
commit d1be007f86
3 changed files with 15 additions and 15 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ namespace COMCMS.Web.Common
public IActionResult AlertAndGoBack(string str)
{
if (!string.IsNullOrWhiteSpace(str)) str = str.Replace("'", "\\'");
return Content($"<script type=\"text/javascript\">alert('{str}');window.history.go(-1)</script>");
return Content($"<script type=\"text/javascript\">alert('{str}');window.history.go(-1)</script>", "text/html", System.Text.Encoding.UTF8);
}
/// <summary>
/// Alert提示并跳转到指定URL
@@ -39,7 +39,7 @@ namespace COMCMS.Web.Common
public IActionResult AlertAndRedirect(string str, string url)
{
if (!string.IsNullOrWhiteSpace(str)) str = str.Replace("'", "\\'");
return Content($"<script type=\"text/javascript\">alert('{str}');window.location='{url}'</script>");
return Content($"<script type=\"text/javascript\">alert('{str}');window.location='{url}'</script>", "text/html", System.Text.Encoding.UTF8);
}
#region MyRegion