Commit 7351c7b8 authored by 叶凯's avatar 叶凯

添加二次跳转

parent 70c437a2
No preview for this file type
......@@ -119,7 +119,7 @@ namespace AppBox
{
var nvc = HttpUtility.ParseQueryString(_url.Query);
nvc.Remove("user");//移除user参数,避免二次清空cookie
LoginSuccess(Request["user"], _url.AbsolutePath + "?" + nvc.ToString());
LoginSuccess(Request["user"], _url.AbsolutePath + (nvc.Count > 0 ? "?" + nvc.ToString() : ""));
}
}
else
......@@ -127,7 +127,7 @@ namespace AppBox
//若已存在登录票据,则使用url的user参数登录
var nvc = HttpUtility.ParseQueryString(Request.Url.Query);
nvc.Remove("user");
LoginSuccess(Request["user"], Request.Url.AbsolutePath + "?" + nvc.ToString());
LoginSuccess(Request["user"], Request.Url.AbsolutePath + (nvc.Count > 0 ? "?" + nvc.ToString() : ""));
}
}
}
......@@ -138,7 +138,7 @@ namespace AppBox
var user = DB.Users.FirstOrDefault(p => p.Name == userId && p.Deleted == 0);
if (user !=null)
{
//RegisterOnlineUser(user);
RegisterOnlineUser(user);
Session["UserPowerList"] = null;
// 用户所属的角色字符串,以逗号分隔
......@@ -153,8 +153,7 @@ namespace AppBox
CreateFormsAuthenticationTicket(user.Name, roleIDs, isPersistent, expiration);
var _requestUrl = Request.Url.AbsolutePath;
// 重定向到登陆后首页
Response.Redirect(RedirectUrl);
Response.Redirect("~/main.aspx?redirurl=" + HttpUtility.UrlEncode(RedirectUrl));
}
else
{
......
No preview for this file type
No preview for this file type
......@@ -22,6 +22,14 @@ namespace AppBox
////////////////////////////////////////////////////////////////
string themeStr = Request.QueryString["theme"];
string menuStr = Request.QueryString["menu"];
if (!string.IsNullOrWhiteSpace(Request.QueryString["redirurl"]))
{
var nvc = HttpUtility.ParseQueryString(Request.Url.Query);
var _url = nvc.Get("redirurl");
var _url2 = HttpUtility.UrlDecode(_url);
Response.Redirect(_url2);
}
if (!String.IsNullOrEmpty(themeStr) || !String.IsNullOrEmpty(menuStr))
{
if (!String.IsNullOrEmpty(themeStr))
......
......@@ -87,4 +87,3 @@ G:\AppBox\AppBox\obj\Debug\AppBox.csproj.AssemblyReference.cache
G:\AppBox\AppBox\obj\Debug\AppBox.csproj.CoreCompileInputs.cache
G:\AppBox\AppBox\obj\Debug\AppBox.dll
G:\AppBox\AppBox\obj\Debug\AppBox.pdb
G:\AppBox\AppBox\obj\Debug\AppBox.csproj.CopyComplete
......@@ -39,4 +39,3 @@ G:\AppBox\MisDelivery\obj\Debug\MisDelivery.csproj.CoreCompileInputs.cache
G:\AppBox\MisDelivery\obj\Debug\MisDelivery.csproj.CopyComplete
G:\AppBox\MisDelivery\obj\Debug\MisDelivery.dll
G:\AppBox\MisDelivery\obj\Debug\MisDelivery.pdb
G:\AppBox\MisDelivery\obj\Debug\MisDelivery.csproj.AssemblyReference.cache
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment