Parcourir la source

统一认证修改

新疆皮山
dao il y a 2 mois
Parent
révision
e8ec350b2a
1 fichiers modifiés avec 49 ajouts et 0 suppressions
  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 Voir le fichier

@@ -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


Chargement…
Annuler
Enregistrer