예제 #1
0
 /// <summary>
 /// 登录退出
 /// </summary>
 /// <returns></returns>
 public ActionResult LogOff()
 {
     try
     {
         string currentUserId = CurrentUserContext.UserID;
         if (SSOAuthorization.IsLogin)
         {
             string msg = SSOAuthorization.Logout();
         }
     }
     catch { }
     //单点登录判断
     if (appConfig.SSOEnable && appConfig.SSOType != 1)
     {
         return(Redirect(appConfig.SSOServerUrl + "?app_regid=" + appConfig.SSORegisterID + "&action=logoff"));
     }
     else
     {
         //设置从注销返回登录页面标记
         if (HttpContext.Application.Get("LogoutFlg") == null)
         {
             HttpContext.Application.Set("LogoutFlg", "true");
         }
         return(Redirect(appConfig.LoginAction));
     }
 }
예제 #2
0
 /// <summary>
 /// 登录退出
 /// </summary>
 /// <returns></returns>
 public ActionResult LogOff()
 {
     try
     {
         string currentUserId = CurrentUserContext.UserID;
         if (SSOAuthorization.IsLogin)
         {
             string msg = SSOAuthorization.Logout();
         }
     }
     catch { }
     //单点登录判断
     if (appConfig.SSOEnable && appConfig.SSOType != 1)
     {
         return(Redirect(appConfig.SSOServerUrl + "?app_regid=" + appConfig.SSORegisterID + "&action=logoff&app_reurl=" + System.Web.HttpUtility.UrlEncode((HttpContext.Request.Url.ToString() ?? "").ToLower().Replace("/admin/logoff", ""))));
     }
     else
     {
         //设置从注销返回登录页面标记
         if (HttpContext.Application.Get("LogoutFlg") == null)
         {
             HttpContext.Application.Set("LogoutFlg", "true");
         }
         return(Redirect(appConfig.LoginAction));
     }
 }