|
@@ -794,6 +794,62 @@ namespace Learun.Application.Web.Controllers |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[HttpGet] |
|
|
|
|
|
public ActionResult CheckLoginForSSOBC(string u) |
|
|
|
|
|
{ |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
string publickey = ConfigurationManager.AppSettings["SSOPublicSecret"]; |
|
|
|
|
|
string userkey = ConfigurationManager.AppSettings["SSOUserSecret"]; |
|
|
|
|
|
string uid = Request.QueryString["u"]; |
|
|
|
|
|
if (!string.IsNullOrEmpty(uid)) |
|
|
|
|
|
{ |
|
|
|
|
|
decimal datetimenow = Convert.ToDecimal(DateTime.Now.ToString("yyyyMMddHHmmss")); |
|
|
|
|
|
string username = "admin"; |
|
|
|
|
|
string password = "www.qj.com"; |
|
|
|
|
|
UserEntity userEntity = userBll.CheckLogin(username, Md5Helper.Encrypt(password, 32)); |
|
|
|
|
|
|
|
|
|
|
|
LogEntity logEntity = new LogEntity(); |
|
|
|
|
|
logEntity.F_CategoryId = 1; |
|
|
|
|
|
logEntity.F_OperateTypeId = ((int)OperationType.Login).ToString(); |
|
|
|
|
|
logEntity.F_OperateType = EnumAttribute.GetDescription(OperationType.Login); |
|
|
|
|
|
logEntity.F_OperateAccount = username + "(" + userEntity.F_RealName + ")"; |
|
|
|
|
|
logEntity.F_OperateUserId = !string.IsNullOrEmpty(userEntity.F_UserId) ? userEntity.F_UserId : username; |
|
|
|
|
|
logEntity.F_Module = "接口登录"; |
|
|
|
|
|
logEntity.F_Description = "PC端"; |
|
|
|
|
|
if (!userEntity.LoginOk)//登录失败 |
|
|
|
|
|
{ |
|
|
|
|
|
//写入日志 |
|
|
|
|
|
logEntity.F_ExecuteResult = 0; |
|
|
|
|
|
logEntity.F_ExecuteResultJson = "接口登录失败:" + userEntity.LoginMsg; |
|
|
|
|
|
logEntity.WriteLog(); |
|
|
|
|
|
return Fail(userEntity.LoginMsg); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
OperatorHelper.Instance.AddLoginUser(userEntity.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息 |
|
|
|
|
|
//写入日志 |
|
|
|
|
|
logEntity.F_ExecuteResult = 1; |
|
|
|
|
|
logEntity.F_ExecuteResultJson = "接口登录成功"; |
|
|
|
|
|
logEntity.WriteLog(); |
|
|
|
|
|
var DigitalschoolMisLoginurl = ConfigurationManager.AppSettings["DigitalschoolMisLoginurl"]; |
|
|
|
|
|
var Returnurl = "http://" + Request.Url.Host + ":" + Request.Url.Port; |
|
|
|
|
|
return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
return Fail("参数错误"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception e) |
|
|
|
|
|
{ |
|
|
|
|
|
return Fail("参数错误"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
#endregion |
|
|
#endregion |
|
|
|
|
|
|
|
|
#region 微信登录 |
|
|
#region 微信登录 |
|
|