|
@@ -666,39 +666,51 @@ namespace Learun.Application.Web.Controllers |
|
|
//修改用户的允许登录结束时间; |
|
|
//修改用户的允许登录结束时间; |
|
|
userBll.UpdateAllowEndTime(userEntity.F_UserId, 0); |
|
|
userBll.UpdateAllowEndTime(userEntity.F_UserId, 0); |
|
|
|
|
|
|
|
|
if (!Returnurl.IsEmpty() && !appid.IsEmpty()) |
|
|
|
|
|
|
|
|
try |
|
|
{ |
|
|
{ |
|
|
var perm_application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); |
|
|
|
|
|
if (perm_application != null) |
|
|
|
|
|
|
|
|
if (!Returnurl.IsEmpty() && !appid.IsEmpty()) |
|
|
{ |
|
|
{ |
|
|
//var userinfo = LoginUserInfo.Get(); |
|
|
|
|
|
//写入当前请求所登录的用户 |
|
|
|
|
|
var type = 0;//1学生 0教师 |
|
|
|
|
|
if (userEntity.F_Description == "学生") |
|
|
|
|
|
|
|
|
var perm_application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); |
|
|
|
|
|
if (perm_application != null) |
|
|
{ |
|
|
{ |
|
|
type = 1; |
|
|
|
|
|
} |
|
|
|
|
|
var url = HttpUtility.UrlDecode(Returnurl); |
|
|
|
|
|
if (url.Contains("?")) |
|
|
|
|
|
{ |
|
|
|
|
|
url += "&appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userEntity.F_RealName, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userEntity.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userEntity.F_EnCode, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
url += "?appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userEntity.F_RealName, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userEntity.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userEntity.F_EnCode, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token); |
|
|
|
|
|
|
|
|
//var userinfo = LoginUserInfo.Get(); |
|
|
|
|
|
//写入当前请求所登录的用户 |
|
|
|
|
|
var type = 0;//1学生 0教师 |
|
|
|
|
|
if (userEntity.F_Description == "学生") |
|
|
|
|
|
{ |
|
|
|
|
|
type = 1; |
|
|
|
|
|
} |
|
|
|
|
|
var url = HttpUtility.UrlDecode(Returnurl); |
|
|
|
|
|
if (url.Contains("?")) |
|
|
|
|
|
{ |
|
|
|
|
|
url += "&appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userEntity.F_RealName, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userEntity.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userEntity.F_EnCode, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
url += "?appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userEntity.F_RealName, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userEntity.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userEntity.F_EnCode, Util.DESEncrypt.Decrypt(perm_application.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token); |
|
|
|
|
|
} |
|
|
|
|
|
Returnurl = url; |
|
|
} |
|
|
} |
|
|
Returnurl = url; |
|
|
|
|
|
|
|
|
Perm_FunctionVisitEntity functionVisitEntity = new Perm_FunctionVisitEntity(); |
|
|
|
|
|
functionVisitEntity.Create(); |
|
|
|
|
|
functionVisitEntity.Fid = perm_application.FId; |
|
|
|
|
|
functionVisitEntity.PDate = DateTime.Now; |
|
|
|
|
|
functionVisitEntity.PUId = userEntity.F_UserId; |
|
|
|
|
|
functionVisitEntity.PUName = userEntity.F_RealName; |
|
|
|
|
|
functionVisitEntity.PIsLoginSuccess = true; |
|
|
|
|
|
functionVisitEntity.PContent = "成功跳转到:" + Returnurl; |
|
|
|
|
|
functionVisitIbll.SaveEntity(null, functionVisitEntity); |
|
|
|
|
|
return Success("登录成功", new { FInterfaceUrl = Returnurl }); |
|
|
} |
|
|
} |
|
|
Perm_FunctionVisitEntity functionVisitEntity = new Perm_FunctionVisitEntity(); |
|
|
|
|
|
functionVisitEntity.Create(); |
|
|
|
|
|
functionVisitEntity.Fid = perm_application.FId; |
|
|
|
|
|
functionVisitEntity.PDate = DateTime.Now; |
|
|
|
|
|
functionVisitEntity.PUId = userEntity.F_UserId; |
|
|
|
|
|
functionVisitEntity.PUName = userEntity.F_RealName; |
|
|
|
|
|
functionVisitEntity.PIsLoginSuccess = true; |
|
|
|
|
|
functionVisitEntity.PContent = "成功跳转到:" + Returnurl; |
|
|
|
|
|
functionVisitIbll.SaveEntity(null, functionVisitEntity); |
|
|
|
|
|
return Success("登录成功", new { FInterfaceUrl = Returnurl }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
logEntity.F_ExecuteResult = 0; |
|
|
|
|
|
logEntity.F_ExecuteResultJson = "跳转失败:" + ex; |
|
|
|
|
|
logEntity.F_SourceContentJson = "Returnurl:" + Returnurl + " appid:" + appid; |
|
|
|
|
|
logEntity.WriteLog(); |
|
|
|
|
|
return Fail("跳转失败"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|