diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs index dd788fb7b..e63133638 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs @@ -153,6 +153,55 @@ namespace Learun.Application.Web.Controllers return Fail("未授权的appid"); } + /// + /// 获取统一认证用户信息 + /// + /// + public ActionResult UserInfo() + { + string appid = Request.QueryString["appid"]; + string appkey = Request.QueryString["appkey"]; + string m = Request.QueryString["m"]; + string t = Request.QueryString["t"]; + if (string.IsNullOrEmpty(appid)) + { + return Fail("参数:appid不能为空"); + } + if (string.IsNullOrEmpty(appkey)) + { + return Fail("参数:appkey不能为空"); + } + if (string.IsNullOrEmpty(m)) + { + return Fail("参数:m不能为空"); + } + if (string.IsNullOrEmpty(t)) + { + return Fail("参数:t不能为空"); + } + var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); + if (application != null) + { + if (Md5Helper.Encrypt(application.FSecret, 32) == appkey) + { + OperatorResult res = OperatorHelper.Instance.IsOnLine(DESEncrypt.Decrypt(t), DESEncrypt.Decrypt(m)); + if (res.stateCode == 1) + { + return Success(res.userInfo); + } + else + { + return Fail("登录无效"); + } + } + else + { + return Fail("appkey错误"); + } + } + else + return Fail("未授权的appid"); + } #endregion #region 统一身份认证2.0