From e8ec350b2a8d041b81dc02069246befa4f31bb6e Mon Sep 17 00:00:00 2001 From: dao Date: Fri, 27 Sep 2024 09:52:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E8=AE=A4=E8=AF=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/SSOSystemController.cs | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) 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