|
|
@@ -392,6 +392,124 @@ namespace Learun.Application.Web.Controllers |
|
|
|
return Fail("userinfo is null"); |
|
|
|
} |
|
|
|
|
|
|
|
[HttpGet] |
|
|
|
public ActionResult Login() |
|
|
|
{ |
|
|
|
//授权验证 |
|
|
|
var lc = LicenseChecker.CheckLicense(); |
|
|
|
if (!lc.Result) |
|
|
|
{ |
|
|
|
return Content("<script>alert('" + lc.Message + "');location.href='about:blank';</script>"); |
|
|
|
} |
|
|
|
//获取错误次数 |
|
|
|
ViewBag.errornum = OperatorHelper.Instance.GetCurrentErrorNum(); |
|
|
|
//获取初始密码设置中已启用的密码 |
|
|
|
ViewBag.IsSetDefaultPwd = false; |
|
|
|
ViewBag.DefaultPwd = ""; |
|
|
|
var defaultPwdEntity = sys_DefaultPwdConfigIBLL.GetEnabledEntity(); |
|
|
|
if (defaultPwdEntity != null) |
|
|
|
{ |
|
|
|
ViewBag.IsSetDefaultPwd = true; |
|
|
|
ViewBag.DefaultPwd = defaultPwdEntity.Pwd; |
|
|
|
} |
|
|
|
//获取高职版跳转地址 |
|
|
|
ViewBag.DigitalschoolMisLoginurl = ConfigurationManager.AppSettings["DigitalschoolMisLoginurl"]; |
|
|
|
//ViewBag.Returnurl = "http://" + Request.Url.Host + ":" + Request.Url.Port; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!Request.QueryString["Returnurl"].IsEmpty()) |
|
|
|
{ |
|
|
|
ViewBag.Returnurl = Request.QueryString["Returnurl"]; |
|
|
|
}; |
|
|
|
if (!Request.QueryString["appid"].IsEmpty()) |
|
|
|
{ |
|
|
|
ViewBag.appid = Request.QueryString["appid"].ToString(); |
|
|
|
}; |
|
|
|
|
|
|
|
//获取登录页二维码配置信息 |
|
|
|
ViewBag.HasQRCode = false; |
|
|
|
var qrcodelist = sys_QRCodeInLoginIBLL.GetList().ToList().Where(x => x.EnabledMark == 1).OrderByDescending(x => x.CreateTime); |
|
|
|
if (qrcodelist.Any()) |
|
|
|
{ |
|
|
|
ViewBag.HasQRCode = true; |
|
|
|
ViewBag.QRCodeUrl = qrcodelist.FirstOrDefault().QRCodeUrl; |
|
|
|
ViewBag.QRCodeText = qrcodelist.FirstOrDefault().Title; |
|
|
|
ViewBag.Title = qrcodelist.FirstOrDefault().Title; |
|
|
|
} |
|
|
|
|
|
|
|
//获取登录页面版本号 |
|
|
|
ViewBag.Version = false; |
|
|
|
var versionlist = sys_UpdateRecordIBLL.GetList().OrderByDescending(x => x.UpdateTime); |
|
|
|
if (versionlist.Any()) |
|
|
|
{ |
|
|
|
ViewBag.Version = true; |
|
|
|
ViewBag.VersionNum = versionlist.FirstOrDefault().VersionNum; |
|
|
|
ViewBag.VersionList = JsonConvert.SerializeObject(versionlist); |
|
|
|
} |
|
|
|
|
|
|
|
var result = teachSwitchIBLL.FindFirst("js"); |
|
|
|
ViewBag.TeachSwitch = result; |
|
|
|
var result2 = teachSwitchIBLL.FindFirst("fx"); |
|
|
|
ViewBag.FeiXinSwitch = result2; |
|
|
|
//网上办事大厅 |
|
|
|
var result3 = teachSwitchIBLL.FindFirst("ssosystem"); |
|
|
|
ViewBag.SSOSystemSwitch = result3; |
|
|
|
//微信快捷登录 |
|
|
|
var result4 = teachSwitchIBLL.FindFirst("wxloginforpc"); |
|
|
|
ViewBag.WeixinLoginSwitch = result4; |
|
|
|
//访客注册 |
|
|
|
var result5 = teachSwitchIBLL.FindFirst("fk"); |
|
|
|
ViewBag.VisitorSwitch = result5; |
|
|
|
//获取在线用户人数 |
|
|
|
ViewBag.OnlineUserNum = 0; |
|
|
|
var onlineUserResult = sys_UpdateRecordIBLL.GetOnlineUserNum(); |
|
|
|
if (onlineUserResult != null) |
|
|
|
{ |
|
|
|
ViewBag.OnlineUserNum = onlineUserResult.OnlineUserNum; |
|
|
|
} |
|
|
|
//获取本机ip |
|
|
|
ViewBag.Ip = GetIP(); |
|
|
|
ViewBag.ACIp = ConfigurationManager.AppSettings["ACIp"] ?? ""; |
|
|
|
ViewBag.ACIp2 = ConfigurationManager.AppSettings["ACIp2"] ?? ""; |
|
|
|
//获取登录页风格 |
|
|
|
var pageEntity = loginModelIbll.FindEnablePage(); |
|
|
|
if (string.IsNullOrEmpty(pageEntity?.Name)) |
|
|
|
{ |
|
|
|
ViewBag.LoGo = "/Content/images/logins/login4.png"; |
|
|
|
return View("Default"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var logoUrl = annexesFileIbll.GetEntityByFolderId(pageEntity.Logo)?.F_FilePath; |
|
|
|
if (string.IsNullOrEmpty(logoUrl)) |
|
|
|
{ |
|
|
|
logoUrl = "/Content/images/logins/login4.png"; |
|
|
|
ViewBag.LoGo = logoUrl; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
ViewBag.LoGo = "/" + logoUrl.Substring(logoUrl.IndexOf("Resource")); |
|
|
|
} |
|
|
|
return View(pageEntity.Name); |
|
|
|
} |
|
|
|
|
|
|
|
//string learn_UItheme = WebHelper.GetCookie("Learn_ADMS_V6.1_UItheme"); |
|
|
|
//switch (learn_UItheme) |
|
|
|
//{ |
|
|
|
// case "1": |
|
|
|
// return View("Default"); // 经典版本 |
|
|
|
// case "2": |
|
|
|
// return View("Accordion"); // 手风琴版本 |
|
|
|
// case "3": |
|
|
|
// return View("Window"); // Windos版本 |
|
|
|
// case "4": |
|
|
|
// return View("Top"); // 顶部菜单版本 |
|
|
|
// default: |
|
|
|
// return View("Default"); // 经典版本 |
|
|
|
//} |
|
|
|
} |
|
|
|
|
|
|
|
[HttpGet] |
|
|
|
public ActionResult PreView(string keyValue) |
|
|
|
{ |
|
|
|