Files
zszq-trs/YLErpWeb/Views/Account/LogOut.cshtml
T
hjhan 44e8ec135c feat(account): 添加登录退出日志记录和SSO优化
- 在登录页面添加访问日志记录,包括IP地址和跳过SSO参数
- 增加天风SSO启用状态的日志输出
- 添加密码登录禁用配置的检查日志
- 在退出登录时记录用户ID、用户名和IP地址
- 优化退出登录流程,避免禁用密码登录时的循环跳转问题
- 为SSO登录添加重新登录按钮样式和功能
- 统一使用远程IP地址变量避免重复获取
- 增加异常处理的日志记录功能
2026-03-23 10:45:09 +08:00

66 lines
2.0 KiB
Plaintext

@model LogOnModel
@{
Layout = null;
ViewBag.Title = "登出";
var disablePasswordLogin = PS.Config?.ErpElement?.DisablePasswordLogin ?? false;
}
<!DOCTYPE html>
<html style="height: 100%;">
<head>
<meta charset="utf-8" />
<title>@GlobalConfig.ProjectTitle</title>
<style>
.sso-login-btn {
display: inline-block;
margin-top: 15px;
padding: 8px 20px;
background: #1890ff;
color: white;
text-decoration: none;
border-radius: 4px;
font-size: 14px;
}
.sso-login-btn:hover {
background: #40a9ff;
}
</style>
</head>
<body style="height:100%;max-height:100%;overflow:hidden;box-sizing:border-box;">
<div id="mainCont">
<div style="width:500px;border:1px dashed #bbb;padding:15px;margin:0 auto;box-sizing:border-box;text-align:center;">
已经登出系统,为安全性考虑,浏览器窗口将在&nbsp;<a href="#" id="aSecond">5秒</a>&nbsp;后自动关闭!
@if (disablePasswordLogin)
{
<br /><br />
<a href="@YLErp.Web.Models.GeneralSSOConfig.AuthUrl" class="sso-login-btn">重新登录</a>
}
</div>
</div>
<script>
var seconds = 5;
function onReady() {
document.body.style.paddingTop = document.body.clientHeight / 3 + 'px'
setInterval(function () {
seconds--;
if (seconds <= 0) {
window.open("about:blank", "_self").close();
} else {
document.getElementById('aSecond').innerText = seconds + "秒";
}
}, 1000);
}
(function ready(fn) {
if (document.readyState != 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}(onReady));
</script>
</body>
</html>