mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-06-26 14:23:09 +08:00
调整部分代码结构
This commit is contained in:
@@ -74,14 +74,14 @@ namespace OpenAuth.App.SSO
|
||||
/// </summary>
|
||||
/// <param name="remark">The remark.</param>
|
||||
/// <returns>LoginUserVM.</returns>
|
||||
public static LoginUserVM GetCurrentUser(string remark = "")
|
||||
public static UserWithAccessedCtrls GetCurrentUser(string remark = "")
|
||||
{
|
||||
|
||||
var requestUri = String.Format("/SSO/Check/GetUser?token={0}&requestid={1}", GetToken(), remark);
|
||||
|
||||
try
|
||||
{
|
||||
var value = _helper.Get<LoginUserVM>(null, requestUri);
|
||||
var value = _helper.Get<UserWithAccessedCtrls>(null, requestUri);
|
||||
return value;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenAuth.App.SSO
|
||||
if (string.IsNullOrEmpty(token))
|
||||
{
|
||||
//直接登录
|
||||
filterContext.Result = SsoLoginResult(cookieSessionUserName);
|
||||
filterContext.Result = LoginResult(cookieSessionUserName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -47,14 +47,14 @@ namespace OpenAuth.App.SSO
|
||||
if (AuthUtil.CheckLogin(token, request.RawUrl) == false)
|
||||
{
|
||||
//会话丢失,跳转到登录页面
|
||||
filterContext.Result = SsoLoginResult(cookieSessionUserName);
|
||||
filterContext.Result = LoginResult(cookieSessionUserName);
|
||||
}
|
||||
}
|
||||
|
||||
base.OnActionExecuting(filterContext);
|
||||
}
|
||||
|
||||
private static ActionResult SsoLoginResult(string username)
|
||||
private static ActionResult LoginResult(string username)
|
||||
{
|
||||
//跳转到SSO站点登陆
|
||||
//return new RedirectResult(string.Format("{0}/sso/login?appkey={1}&username={2}",
|
||||
|
||||
@@ -57,7 +57,8 @@ namespace OpenAuth.App.SSO
|
||||
if (string.IsNullOrEmpty(token))
|
||||
{
|
||||
//直接登录
|
||||
filterContext.Result = SsoLoginResult(cookieSessionUserName);
|
||||
filterContext.Result = LoginResult(cookieSessionUserName);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -65,14 +66,15 @@ namespace OpenAuth.App.SSO
|
||||
if (AuthUtil.CheckLogin(token, request.RawUrl) == false)
|
||||
{
|
||||
//会话丢失,跳转到登录页面
|
||||
filterContext.Result = SsoLoginResult(cookieSessionUserName);
|
||||
filterContext.Result = LoginResult(cookieSessionUserName);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
base.OnActionExecuting(filterContext);
|
||||
}
|
||||
|
||||
private static ActionResult SsoLoginResult(string username)
|
||||
private static ActionResult LoginResult(string username)
|
||||
{
|
||||
//跳转到SSO站点登陆
|
||||
//return new RedirectResult(string.Format("{0}/sso/login?appkey={1}&username={2}",
|
||||
|
||||
Reference in New Issue
Block a user