浏览代码

统一认证修改

新疆皮山
dao 2 个月前
父节点
当前提交
e8ec350b2a
共有 1 个文件被更改,包括 49 次插入0 次删除
  1. +49
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs

+ 49
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs 查看文件

@@ -153,6 +153,55 @@ namespace Learun.Application.Web.Controllers
return Fail("未授权的appid");
}

/// <summary>
/// 获取统一认证用户信息
/// </summary>
/// <returns></returns>
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


正在加载...
取消
保存