Skip to content

Commit

Permalink
修复页面URL输入中文异常 #130
Browse files Browse the repository at this point in the history
  • Loading branch information
SeriaWei committed Jan 5, 2018
1 parent b8217e5 commit 77c0383
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ZKEACMS/Controllers/PageController.cs
Expand Up @@ -11,6 +11,7 @@
using Easy.ViewPort.jsTree;
using Microsoft.AspNetCore.Mvc;
using System.Linq;
using System.Net;
using ZKEACMS.Common.ViewModels;
using ZKEACMS.Filter;
using ZKEACMS.Layout;
Expand Down Expand Up @@ -178,7 +179,13 @@ public JsonResult DeleteVersion(string ID)
}
public IActionResult RedirectView(string Id, bool? preview)
{
return Redirect(Service.Get(Id).Url + ((preview ?? true) ? "?ViewType=" + ReView.Review : ""));
var pathArray = Service.Get(Id).Url.Split('/');
for (int i = 1; i < pathArray.Length; i++)
{
pathArray[i] = WebUtility.UrlEncode(pathArray[i]);
}
var url = string.Join("/", pathArray);
return Redirect(url + ((preview ?? true) ? "?ViewType=" + ReView.Review : ""));
}
[DefaultAuthorize(Policy = PermissionKeys.ViewPage)]
public IActionResult Select()
Expand Down

0 comments on commit 77c0383

Please sign in to comment.