From e93fad9a4847a1949916dcc305f502883d670d9f Mon Sep 17 00:00:00 2001 From: zhichao lei <442149704@qq.com> Date: Mon, 22 Feb 2021 17:25:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E8=AE=A4=E8=AF=81=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/LoginController.cs | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs index 32fd91b1c..74f1b6f45 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs @@ -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 #region 微信登录