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 404049e80..fc75f49da 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs
@@ -18,6 +18,7 @@ using Learun.Cache.Factory;
using Newtonsoft.Json;
using Learun.Application.TwoDevelopment.LR_Desktop;
using Learun.Application.TwoDevelopment.PersonnelManagement;
+using Learun.Application.WeChat;
namespace Learun.Application.Web.Controllers
{
@@ -58,7 +59,10 @@ namespace Learun.Application.Web.Controllers
private StuConsumptionIBLL stuConsumptionIBLL = new StuConsumptionBLL();
private MealCardRunTabIBLL mealCardRunTabIBLL = new MealCardRunTabBLL();
private Sys_UpdateRecordIBLL sys_UpdateRecordIBLL = new Sys_UpdateRecordBLL();
-
+ ///
+ /// 标记登录的浏览器
+ ///
+ private string LoginUserMarkKey = "Learun_ADMS_V7_Mark";
#region 统一身份认证3.0
///
/// 退出
@@ -951,6 +955,7 @@ namespace Learun.Application.Web.Controllers
{
try
{
+ //var user = LoginUserInfo.Get();
string redi = Request.QueryString["redi"];
if (!string.IsNullOrEmpty(redi))
{
@@ -966,6 +971,11 @@ namespace Learun.Application.Web.Controllers
functionVisitEntity.PDate = DateTime.Now;
functionVisitEntity.PUId = userid;
var userinfo = userBll.GetEntityByUserId(userid);
+ var type = 0;//1学生 0教师
+ if (userinfo.F_Description == "学生")
+ {
+ type = 1;
+ }
functionVisitEntity.PUName = userinfo.F_RealName;
if (uplist == null)
{
@@ -980,22 +990,37 @@ namespace Learun.Application.Web.Controllers
{
if (!string.IsNullOrEmpty(perfun.FInterfaceUrl))
{
- if (!string.IsNullOrEmpty(perfun.UPUserName) && !string.IsNullOrEmpty(perfun.UPPass))
+ var url = perfun.FUrl;
+ var token = OperatorHelper.Instance.AddLoginUser(userinfo.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息
+ string loginMark = WebHelper.GetCookie(LoginUserMarkKey).ToString();
+ if (url.Contains("?"))
{
- var user = LoginUserInfo.Get();
- functionVisitEntity.PIsLoginSuccess = true;
- functionVisitEntity.PContent = "成功转到统一认证网站:" + perfun.FUrl;
- functionVisitIbll.SaveEntity(null, functionVisitEntity);
- return Redirect(perfun.FInterfaceUrl + "?u=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPUserName, secretkey), publickey) + "&p=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPPass, secretkey), publickey) + "&t=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(DateTime.Now.ToString("yyyyMMddHHmmss"), secretkey), publickey) + "&ip=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(GetIP(), secretkey), publickey)+"&m=" + DESEncrypt.Encrypt(user.loginMark) + "&t=" + DESEncrypt.Encrypt(user.token));
+ url += "&appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userinfo.F_RealName, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userinfo.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userinfo.F_EnCode, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token);
}
else
{
- functionVisitEntity.PIsLoginSuccess = false;
- functionVisitEntity.PContent = "用户未配置转到用户名密码配置页面";
- functionVisitIbll.SaveEntity(null, functionVisitEntity);
- //用户未配置转到用户名密码配置页面
- return Redirect("/SSOSystem/FirstLogin?sysid=" + sysid + "&openid=" + openid);
+ url += "?appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userinfo.F_RealName, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userinfo.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userinfo.F_EnCode, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token);
}
+ return Redirect(url);
+
+
+ //if (!string.IsNullOrEmpty(perfun.UPUserName) && !string.IsNullOrEmpty(perfun.UPPass))
+ //{
+ // var token = OperatorHelper.Instance.AddLoginUser(userinfo.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息
+ // string loginMark = WebHelper.GetCookie(LoginUserMarkKey).ToString();
+ // functionVisitEntity.PIsLoginSuccess = true;
+ // functionVisitEntity.PContent = "成功转到统一认证网站:" + perfun.FUrl;
+ // functionVisitIbll.SaveEntity(null, functionVisitEntity);
+ // //return Redirect(perfun.FInterfaceUrl + "?u=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPUserName, secretkey), publickey) + "&p=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPPass, secretkey), publickey) + "&t=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(DateTime.Now.ToString("yyyyMMddHHmmss"), secretkey), publickey) + "&ip=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(GetIP(), secretkey), publickey)+"&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token));
+ //}
+ //else
+ //{
+ // functionVisitEntity.PIsLoginSuccess = false;
+ // functionVisitEntity.PContent = "用户未配置转到用户名密码配置页面";
+ // functionVisitIbll.SaveEntity(null, functionVisitEntity);
+ // //用户未配置转到用户名密码配置页面
+ // return Redirect("/SSOSystem/FirstLogin?sysid=" + sysid + "&openid=" + openid);
+ //}
}
else
{