Bladeren bron

枝江中职分支
ndbs 1 dag geleden
bovenliggende
commit
812bca6e61
2 gewijzigde bestanden met toevoegingen van 67 en 52 verwijderingen
  1. +0
    -0
      Learun.Framework.Ultimate V7/Doc文档/~$化智慧校园统一身份认证对接说明V1.0.docx
  2. +67
    -52
      Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs

+ 0
- 0
Learun.Framework.Ultimate V7/Doc文档/~$化智慧校园统一身份认证对接说明V1.0.docx Bestand weergeven


+ 67
- 52
Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs Bestand weergeven

@@ -277,8 +277,8 @@ namespace Learun.Application.Web.Controllers

return Redirect("NoLogin");
}
var userinfo = LoginUserInfo.Get();
if (userinfo.Description == "学生")
var userInfo = LoginUserInfo.Get();
if (userInfo.Description == "学生")
{
return Redirect("NoLogin");
}
@@ -299,7 +299,7 @@ namespace Learun.Application.Web.Controllers


List<ModuleEntity> list = new List<ModuleEntity>();
List<string> offenused = LogBLL.GetGroupLog(userinfo.userId).Select(m => m.F_Module).Take(20).ToList();
List<string> offenused = LogBLL.GetGroupLog(userInfo.userId).Select(m => m.F_Module).Take(20).ToList();
var data = moduleIBLL.GetModuleList().Where(m => m.F_EnabledMark == 1 && m.F_DeleteMark == 0 && !string.IsNullOrEmpty(m.F_UrlAddress));
foreach (var oitem in offenused)
{
@@ -313,13 +313,13 @@ namespace Learun.Application.Web.Controllers
ViewBag.Offenused = list.Take(12);
//内部邮件
Pagination paginationobj = new Pagination() { rows = 5, page = 1, sidx = "readflag asc,SENDTIME desc ", sord = "desc" };
var maildata = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userinfo.userId + "\"}");
var maildata = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
ViewBag.LanMail = maildata;
ViewBag.LanMailUnRead = maildata.Count(m => m.READFLAG == 0);
//办公事项
paginationobj.sidx = "F_CreateDate";
//ViewBag.TaskList = wfTaskIBLL.GetActiveList(userinfo, paginationobj, "{}");
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userinfo, paginationobj, "{}");
//ViewBag.TaskList = wfTaskIBLL.GetActiveList(userInfo, paginationobj, "{}");
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}");

//公告
List<NewsEntity> outnewslist = new List<NewsEntity>();
@@ -330,11 +330,11 @@ namespace Learun.Application.Web.Controllers
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
{
if (!string.IsNullOrEmpty(userinfo.postIds))
if (!string.IsNullOrEmpty(userInfo.postIds))
{
if (userinfo.postIds.Contains(","))
if (userInfo.postIds.Contains(","))
{
foreach (var postid in userinfo.postIds.Split(','))
foreach (var postid in userInfo.postIds.Split(','))
{
if (newsitemEntity.F_SendPostId.Contains(postid))
{
@@ -345,7 +345,7 @@ namespace Learun.Application.Web.Controllers
}
else
{
if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
if (newsitemEntity.F_SendPostId.Contains(userInfo.postIds))
{
outnewslist.Add(newsitemEntity);
}
@@ -356,7 +356,7 @@ namespace Learun.Application.Web.Controllers
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
{
if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
if (newsitemEntity.F_SendDeptId.Contains(userInfo.departmentId))
{
outnewslist.Add(newsitemEntity);
}
@@ -370,11 +370,11 @@ namespace Learun.Application.Web.Controllers
//公文
paginationobj.sidx = "SendTime";
paginationobj.rows = 5;
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userinfo.userId + "\"}");
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userInfo.userId + "\"}");
ViewBag.NewsList = outnewslist;
//底部办公事项
ViewBag.FunctionTypeList = perm_FunctionTypeIBLL.GetListByUserId(userinfo.userId).OrderBy(m => m.FTOrder).Take(7);
var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userinfo.userId);
ViewBag.FunctionTypeList = perm_FunctionTypeIBLL.GetListByUserId(userInfo.userId).OrderBy(m => m.FTOrder).Take(7);
var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userInfo.userId);
foreach (var ufitem in userfunctionlist)
{
if (!string.IsNullOrEmpty(ufitem.FImage))
@@ -460,7 +460,7 @@ namespace Learun.Application.Web.Controllers
[HandlerLogin(FilterMode.Enforce)]
public ActionResult NewsList()
{
var userinfo = LoginUserInfo.Get();
var userInfo = LoginUserInfo.Get();
int page = 1;
if (!string.IsNullOrEmpty(Request.QueryString["page"]))
{
@@ -476,11 +476,11 @@ namespace Learun.Application.Web.Controllers
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
{
if (!string.IsNullOrEmpty(userinfo.postIds))
if (!string.IsNullOrEmpty(userInfo.postIds))
{
if (userinfo.postIds.Contains(","))
if (userInfo.postIds.Contains(","))
{
foreach (var postid in userinfo.postIds.Split(','))
foreach (var postid in userInfo.postIds.Split(','))
{
if (newsitemEntity.F_SendPostId.Contains(postid))
{
@@ -491,7 +491,7 @@ namespace Learun.Application.Web.Controllers
}
else
{
if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
if (newsitemEntity.F_SendPostId.Contains(userInfo.postIds))
{
newsListSelf.Add(newsitemEntity);
}
@@ -502,7 +502,7 @@ namespace Learun.Application.Web.Controllers
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
{
if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
if (newsitemEntity.F_SendDeptId.Contains(userInfo.departmentId))
{
newsListSelf.Add(newsitemEntity);
}
@@ -549,7 +549,7 @@ namespace Learun.Application.Web.Controllers
[HandlerLogin(FilterMode.Enforce)]
public ActionResult newsTwo()
{
var userinfo = LoginUserInfo.Get();
var userInfo = LoginUserInfo.Get();
int page = 1;
if (!string.IsNullOrEmpty(Request.QueryString["page"]))
{
@@ -564,11 +564,11 @@ namespace Learun.Application.Web.Controllers
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
{
if (!string.IsNullOrEmpty(userinfo.postIds))
if (!string.IsNullOrEmpty(userInfo.postIds))
{
if (userinfo.postIds.Contains(","))
if (userInfo.postIds.Contains(","))
{
foreach (var postid in userinfo.postIds.Split(','))
foreach (var postid in userInfo.postIds.Split(','))
{
if (newsitemEntity.F_SendPostId.Contains(postid))
{
@@ -579,7 +579,7 @@ namespace Learun.Application.Web.Controllers
}
else
{
if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
if (newsitemEntity.F_SendPostId.Contains(userInfo.postIds))
{
newsListSelf.Add(newsitemEntity);
}
@@ -590,7 +590,7 @@ namespace Learun.Application.Web.Controllers
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
{
if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
if (newsitemEntity.F_SendDeptId.Contains(userInfo.departmentId))
{
newsListSelf.Add(newsitemEntity);
}
@@ -632,14 +632,14 @@ namespace Learun.Application.Web.Controllers
ViewBag.NewsList = newsListSelf;
//内部邮件
paginationobj.sidx = "readflag asc,SENDTIME desc ";
ViewBag.LanMail = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userinfo.userId + "\"}");
ViewBag.LanMail = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
//办公事项
paginationobj.sidx = "F_CreateDate";
//ViewBag.TaskList = wfTaskIBLL.GetActiveList(userinfo, paginationobj, "{}");
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userinfo, paginationobj, "{}");
//ViewBag.TaskList = wfTaskIBLL.GetActiveList(userInfo, paginationobj, "{}");
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}");
//学校公文
paginationobj.sidx = "SendTime";
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userinfo.userId + "\"}");
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userInfo.userId + "\"}");

return View();
}
@@ -647,41 +647,41 @@ namespace Learun.Application.Web.Controllers

public PartialViewResult LanMail()
{
var userinfo = LoginUserInfo.Get();
var userInfo = LoginUserInfo.Get();
int page = 1;
if (!string.IsNullOrEmpty(Request.QueryString["page"]))
{
page = Convert.ToInt32(Request.QueryString["page"]);
}
Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "readflag asc,SENDTIME desc", sord = "desc" };
ViewBag.LanMail = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userinfo.userId + "\"}");
ViewBag.LanMail = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
return PartialView(paginationobj);
}

public PartialViewResult TaskList()
{
var userinfo = LoginUserInfo.Get();
var userInfo = LoginUserInfo.Get();
int page = 1;
if (!string.IsNullOrEmpty(Request.QueryString["page"]))
{
page = Convert.ToInt32(Request.QueryString["page"]);
}
Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "F_CreateDate", sord = "desc" };
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userinfo, paginationobj, "{}");
//ViewBag.TaskList = wfTaskIBLL.GetActiveList(userinfo, paginationobj, "{}");
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}");
//ViewBag.TaskList = wfTaskIBLL.GetActiveList(userInfo, paginationobj, "{}");
return PartialView(paginationobj);
}

public PartialViewResult ReceiveFileList()
{
var userinfo = LoginUserInfo.Get();
var userInfo = LoginUserInfo.Get();
int page = 1;
if (!string.IsNullOrEmpty(Request.QueryString["page"]))
{
page = Convert.ToInt32(Request.QueryString["page"]);
}
Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "SendTime", sord = "desc" };
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userinfo.userId + "\"}");
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userInfo.userId + "\"}");
return PartialView(paginationobj);
}

@@ -691,7 +691,7 @@ namespace Learun.Application.Web.Controllers

public PartialViewResult NewList()
{
var userinfo = LoginUserInfo.Get();
var userInfo = LoginUserInfo.Get();
int page = 1;
if (!string.IsNullOrEmpty(Request.QueryString["page"]))
{
@@ -706,11 +706,11 @@ namespace Learun.Application.Web.Controllers
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
{
if (!string.IsNullOrEmpty(userinfo.postIds))
if (!string.IsNullOrEmpty(userInfo.postIds))
{
if (userinfo.postIds.Contains(","))
if (userInfo.postIds.Contains(","))
{
foreach (var postid in userinfo.postIds.Split(','))
foreach (var postid in userInfo.postIds.Split(','))
{
if (newsitemEntity.F_SendPostId.Contains(postid))
{
@@ -721,7 +721,7 @@ namespace Learun.Application.Web.Controllers
}
else
{
if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
if (newsitemEntity.F_SendPostId.Contains(userInfo.postIds))
{
newsListSelf.Add(newsitemEntity);
}
@@ -732,7 +732,7 @@ namespace Learun.Application.Web.Controllers
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
{
if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
if (newsitemEntity.F_SendDeptId.Contains(userInfo.departmentId))
{
newsListSelf.Add(newsitemEntity);
}
@@ -970,13 +970,13 @@ namespace Learun.Application.Web.Controllers
functionVisitEntity.Fid = strsysid;
functionVisitEntity.PDate = DateTime.Now;
functionVisitEntity.PUId = userid;
var userinfo = userBll.GetEntityByUserId(userid);
var userInfo = userBll.GetEntityByUserId(userid);
var type = 0;//1学生 0教师
if (userinfo.F_Description == "学生")
if (userInfo.F_Description == "学生")
{
type = 1;
}
functionVisitEntity.PUName = userinfo.F_RealName;
functionVisitEntity.PUName = userInfo.F_RealName;
if (uplist == null)
{
functionVisitEntity.PIsLoginSuccess = false;
@@ -991,15 +991,15 @@ namespace Learun.Application.Web.Controllers
if (!string.IsNullOrEmpty(perfun.FInterfaceUrl))
{
var url = perfun.FUrl;
var token = OperatorHelper.Instance.AddLoginUser(userinfo.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息
var token = OperatorHelper.Instance.AddLoginUser(userInfo.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息
string loginMark = WebHelper.GetCookie(LoginUserMarkKey).ToString();
if (url.Contains("?"))
{
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);
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
{
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);
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);
}
Util.Log.LogHelper.Info($"2{url};");
return Redirect(url);
@@ -1007,7 +1007,7 @@ namespace Learun.Application.Web.Controllers

//if (!string.IsNullOrEmpty(perfun.UPUserName) && !string.IsNullOrEmpty(perfun.UPPass))
//{
// var token = OperatorHelper.Instance.AddLoginUser(userinfo.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息
// 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;
@@ -1602,8 +1602,23 @@ namespace Learun.Application.Web.Controllers
});
ViewBag.FunctionList = ff;
ViewBag.FunctionListStr = JsonConvert.SerializeObject(ViewBag.FunctionList);
var type = 0;//1学生 0教师
if (userInfo.Description == "学生")
{
type = 1;
}

string publickey = ConfigurationManager.AppSettings["SSOPublicSecret"];
var uplist = permUserPermissionIbll.GetPerm_UserPermissionEntityByFIdAndUid("b8177366-e4ca-446a-966f-c891228b8fcd", userInfo.userId);
var perfun = perm_FunctionIBLL.GetPerm_FunctionEntityByUPId(uplist.UPId);

var FSecret = DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]);
ViewBag.TYRZ = "?appkey=" + Md5Helper.Encrypt(FSecret, 32)
+ "&name=" + DESEncrypt.Encrypt(userInfo.realName, FSecret, false)
+ "&no=" + DESEncrypt.Encrypt(userInfo.IdentityCardNo, FSecret, false)
+ "&acc=" + DESEncrypt.Encrypt(userInfo.enCode, perfun.FSecret, false)
+ "&type=" + type + "&m=" + DESEncrypt.Encrypt(userInfo.loginMark)
+ "&t=" + DESEncrypt.Encrypt(userInfo.token);
return View();
}

@@ -1792,7 +1807,7 @@ namespace Learun.Application.Web.Controllers
ViewBag.TaskListStr = JsonConvert.SerializeObject(ListTaskrows);
ViewBag.TaskList = ViewBag.TaskListStr;
}
}
else
{
@@ -1848,7 +1863,7 @@ namespace Learun.Application.Web.Controllers
ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ListFinishrows);
ViewBag.FinishTaskList = ViewBag.FinishTaskListStr;
}
}
else
{


Laden…
Annuleren
Opslaan