diff --git a/YLErpWeb/App/Startup.cs b/YLErpWeb/App/Startup.cs index 7616e956..b44712ac 100644 --- a/YLErpWeb/App/Startup.cs +++ b/YLErpWeb/App/Startup.cs @@ -20,7 +20,7 @@ namespace YLErp.Web GlobalConfig.EnableGenerateOnTradeClosed = true; GlobalConfig.OverrideOldDoc = true; - GlobalConfig.ProjectTitle = "场外衍生品交易管理系统"; + GlobalConfig.ProjectTitle = "固收场外衍生品系统"; GlobalConfig.GetNameByUserId = UserBLL.GetNameById; GlobalConfig.SealHandler = new SealTaskHandleService(OptUserInfo.SystemUser); diff --git a/YLErpWeb/Controllers/AccountController.cs b/YLErpWeb/Controllers/AccountController.cs index 3efa8a20..889f8c9a 100644 --- a/YLErpWeb/Controllers/AccountController.cs +++ b/YLErpWeb/Controllers/AccountController.cs @@ -69,7 +69,7 @@ namespace YLErp.Web.Controllers // 注意:DisablePasswordLogin 的逻辑在 Login.cshtml 视图中处理 // 这里不再直接跳转,而是显示登录页,由页面决定显示什么内容 - return LoginError(null); + return View(); } public ActionResult Login2() @@ -77,6 +77,14 @@ namespace YLErp.Web.Controllers return Login(true); } + /// + /// 内置超管账密登录兜底页 + /// + public ActionResult AdminLogin() + { + return LoginError(null); + } + /// /// 登录错误 /// @@ -113,7 +121,7 @@ namespace YLErp.Web.Controllers model.SID = DataProtectHelper.Encrypt(sid); } - return View(nameof(Login), model); + return View(nameof(AdminLogin), model); } [HttpPost, ResponseCache(NoStore = true)] diff --git a/YLErpWeb/Views/Account/AdminLogin.cshtml b/YLErpWeb/Views/Account/AdminLogin.cshtml new file mode 100644 index 00000000..5685b91b --- /dev/null +++ b/YLErpWeb/Views/Account/AdminLogin.cshtml @@ -0,0 +1,166 @@ +@model LogOnModel + +@{ + Layout = null; + ViewBag.Title = "登录"; + var captchaUrl = Url.Action("Captcha") + "?sid=" + Model.SID; + Model.LoadTime = DateTime.Now; + var disablePasswordLogin = PS.Config?.ErpElement?.DisablePasswordLogin ?? false; + var ssoEnable = YLErp.Web.Models.GeneralSSOConfig.Enable; +} + + + + + + @GlobalConfig.ProjectTitle + + + + + + +
+
+ +
+
+
@GlobalConfig.ProjectTitle
+ @if (disablePasswordLogin) + { + +
+

请使用飞连登录

+ @if (ssoEnable) + { + + } + else + { +

SSO登录未配置,请联系管理员

+ } +
+ } + else + { + +
+ + + + + + + + + + + + + + + + + + @if (Model.NeedCaptcha) + { + + + + + } + + + + + +
+ } +
+ Copyright © 2020 YieldChain All rights reserved. +
+
+
+ +
@(Model.Exception?.ToString())
+ + + + diff --git a/YLErpWeb/Views/Account/Login.cshtml b/YLErpWeb/Views/Account/Login.cshtml index f71d0ea7..3b6479e1 100644 --- a/YLErpWeb/Views/Account/Login.cshtml +++ b/YLErpWeb/Views/Account/Login.cshtml @@ -1,12 +1,8 @@ -@model LogOnModel - @{ Layout = null; ViewBag.Title = "登录"; - var captchaUrl = Url.Action("Captcha") + "?sid=" + Model.SID; - Model.LoadTime = DateTime.Now; - var disablePasswordLogin = PS.Config?.ErpElement?.DisablePasswordLogin ?? false; var ssoEnable = YLErp.Web.Models.GeneralSSOConfig.Enable; + var authUrl = YLErp.Web.Models.GeneralSSOConfig.AuthUrl; } @@ -14,153 +10,96 @@ @GlobalConfig.ProjectTitle - - - + .login-page { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 80px 24px 40px; } + .login-main { margin: auto; width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; } + .login-header { position: absolute; top: 30px; left: 34px; display: flex; align-items: center; gap: 10px; } + .login-header .brand { font-size: 23px; letter-spacing: -0.055em; color: #1D1A1A; font-weight: 400; line-height: 1; } + .login-header .brand b { font-weight: 800; color: #C0221E; } + .login-header .sub { display: block; margin-top: 3px; font-size: 11px; letter-spacing: 0.055em; color: #938A8A; } + .login-title { text-align: center; margin-bottom: 24px; } + .login-title h1 { font-size: 24px; line-height: 36px; letter-spacing: -0.025em; color: #1F1F1F; font-weight: 700; } + .login-title h1 .accent { color: #C0221E; font-weight: 800; letter-spacing: -0.04em; } + .login-title p { margin-top: 8px; font-size: 13px; line-height: 19.5px; color: #ADADAD; } + .login-card { width: 380px; max-width: 100%; padding: 36px 36px 32px; background: #FFFFFF; border-radius: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 10px 48px rgba(0,0,0,.1); text-align: center; } + .sso-icon { display: flex; align-items: center; justify-content: center; width: 80px; height: 80px; margin: 0 auto; border-radius: 40px; background: linear-gradient(135deg, #F5E8E8 0%, #F9E0E0 100%); box-shadow: 0 6px 24px rgba(192,34,30,.14); } + .sso-icon img { width: 36px; height: 36px; } + .sso-title { margin-top: 16px; font-size: 14px; font-weight: 600; line-height: 21px; color: #1F1F1F; } + .sso-desc { margin-top: 4px; font-size: 12px; line-height: 19.2px; color: #ADADAD; } + .sso-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 51px; margin-top: 32px; border: none; border-radius: 10px; background: #C0221E; box-shadow: 0 4px 18px rgba(192,34,30,.3); color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 0.04em; text-decoration: none; cursor: pointer; transition: opacity .2s; } + .sso-btn:hover { opacity: .9; color: #fff; text-decoration: none; } + .sso-btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; line-height: 0; } + .sso-btn img { width: 17px; height: 17px; display: block; } + .sso-btn-text { line-height: 1; } + .sso-btn.disabled { background: #ccc; box-shadow: none; cursor: not-allowed; pointer-events: none; } + .sso-btn.loading { background: #E04B48; box-shadow: 0 4px 18px rgba(192,34,30,.25); pointer-events: none; opacity: 1; color: #fff; } + @@keyframes spin { to { transform: rotate(360deg); } } + .sso-spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; } + .sso-error { margin-top: 10px; font-size: 12px; color: #ff6b6b; } + .admin-link { position: absolute; bottom: 16px; left: 24px; font-size: 12px; color: #ADADAD; text-decoration: none; } + .admin-link:hover { color: #C0221E; } + - -
-
-