From 0fb8b64e383818a792391a8ddc25bf19c80c057b Mon Sep 17 00:00:00 2001 From: dao Date: Thu, 17 Oct 2024 14:20:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=99=BB=E5=BD=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E5=8E=9F=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E7=BB=9F=E4=B8=80=E8=AE=A4=E8=AF=81=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/LoginController.cs | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs index 55a7a9b12..e304e84f4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs @@ -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(""); + } + //获取错误次数 + 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) {