private void LogOff <T>(T param, InvokeResult <LogOffRet> result) where T : LogOffParam { if (param is LogOffUserParam) { SPParam theSPParam = new ObjectToken { ApplicationIdFrom = param.ApplicationIdFrom, ApplicationIdTo = param.ApplicationIdTo, Token = param.Token }.ToSPParam(); BuilderFactory.DefaultBulder().ExecuteSPNoneQuery("SP_Cer_SignOut", theSPParam); if (theSPParam.ErrorCode == 0) { //浏览器类 Redirect r = Global.redirects.FirstOrDefault(item => item.ApplicationIdFrom == param.ApplicationIdFrom && item.ApplicationIdTo == param.ApplicationIdTo && item.Tag == "SignOut"); if (r != null) { theSPParam.MixInWithDictionary(param.ToStringObjectDictionary()); result.ret.RedirectUrl = r.Url.ReplaceWithKeys(theSPParam); } } else { result.Success = false; result.ErrorMessage = theSPParam.ErrorMessage; } } }
protected void LogOffUser <T, V>(T param, InvokeResult <V> result) where T : LogOffUserParam where V : LogOffUserRet { if (param is LogOffUserParam) { string connectstring_Or_Dbname = null; if (param.ObjectId != "*") { var deployNode = GlobalManager.DeployNodes.SingleOrDefault(item => item.ApplicationIdFrom == param.ApplicationIdFrom && item.ApplicationIdTo == param.ApplicationIdTo && item.ObjectId == param.ObjectId && item.RunMode.Value == param.RunMode); if (deployNode != null) { connectstring_Or_Dbname = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(deployNode.ConnectString)); } } else { connectstring_Or_Dbname = Global.oldConnectString; } SPParam theSPParam = new ObjectToken { ApplicationIdFrom = param.ApplicationIdFrom, ApplicationIdTo = param.ApplicationIdTo, Token = param.Token }.ToSPParam(); BuilderFactory.DefaultBulder(connectstring_Or_Dbname).ExecuteSPNoneQuery("SP_Cer_SignOut", theSPParam); if (theSPParam.ErrorCode == 0) { //浏览器类 Redirect r = Global.redirects.FirstOrDefault(item => item.ApplicationIdFrom == param.ApplicationIdFrom && item.ApplicationIdTo == param.ApplicationIdTo && item.ObjectId == param.ObjectId && item.Tag == (param.Tag ?? "SignOut")); if (r != null) { theSPParam.MixInWithDictionary(param.ToStringObjectDictionary()); result.ret.RedirectUrl = r.Url.ReplaceWithKeys(theSPParam); } } else { result.Success = false; result.ErrorMessage = theSPParam.ErrorMessage; } } }