登录会话和日志查询优化,增加IP地址归属地显示,删除loginUrl字段

This commit is contained in:
shimingxy
2024-10-31 09:24:39 +08:00
parent 3b02362e22
commit 430da59963
8 changed files with 11 additions and 20 deletions

View File

@@ -79,8 +79,6 @@ public class HistoryLogin extends JpaEntity implements Serializable{
@Column
String application;
@Column
String loginUrl;
@Column
Date loginTime;
@Column
Date logoutTime;
@@ -234,14 +232,6 @@ public class HistoryLogin extends JpaEntity implements Serializable{
this.application = application;
}
public String getLoginUrl() {
return loginUrl;
}
public void setLoginUrl(String loginUrl) {
this.loginUrl = loginUrl;
}
public Date getLoginTime() {
return loginTime;
}
@@ -335,8 +325,6 @@ public class HistoryLogin extends JpaEntity implements Serializable{
builder.append(platform);
builder.append(", application=");
builder.append(application);
builder.append(", loginUrl=");
builder.append(loginUrl);
builder.append(", loginTime=");
builder.append(loginTime);
builder.append(", logoutTime=");

View File

@@ -47,10 +47,9 @@ public class LoginHistoryRepository {
browser ,
platform ,
application ,
loginurl ,
sessionstatus ,
instid)
values( ? , ? , ? , ? , ? , ? , ? , ? , ?, ? , ? , ? , ?, ?, ? , ? , ?, ? , ? , ?)
values( ? , ? , ? , ? , ? , ? , ? , ?, ? , ? , ? , ?, ?, ? , ? , ?, ? , ? , ?)
""";
protected JdbcTemplate jdbcTemplate;
@@ -61,7 +60,6 @@ public class LoginHistoryRepository {
public void login(HistoryLogin historyLogin) {
historyLogin.setId(WebContext.genId());
historyLogin.setLoginUrl(WebContext.getRequest().getRequestURI());
//Thread insert
new Thread(new HistoryLoginRunnable(jdbcTemplate,historyLogin)).start();
}
@@ -101,7 +99,6 @@ public class LoginHistoryRepository {
historyLogin.getBrowser(),
historyLogin.getPlatform(),
"Browser",
historyLogin.getLoginUrl(),
historyLogin.getSessionStatus(),
historyLogin.getInstId()
},
@@ -123,7 +120,6 @@ public class LoginHistoryRepository {
Types.VARCHAR,
Types.VARCHAR,
Types.VARCHAR,
Types.VARCHAR,
Types.INTEGER,
Types.VARCHAR
});

View File

@@ -50,10 +50,10 @@
code,
provider,
sourceip,
location,
browser,
platform,
application,
loginurl,
logintime,
logouttime
from mxk_history_login
@@ -76,10 +76,10 @@
code,
provider,
sourceip,
location,
browser,
platform,
application,
loginurl,
logintime,
logouttime
from mxk_history_login

View File

@@ -73,6 +73,7 @@
<th nzAlign="center">{{ 'mxk.history.login.username' | i18n }}</th>
<th nzAlign="center">{{ 'mxk.history.login.displayName' | i18n }}</th>
<th nzAlign="center">{{ 'mxk.history.login.sourceIp' | i18n }}</th>
<th nzAlign="center">{{ 'mxk.history.login.location' | i18n }}</th>
<th nzAlign="center">{{ 'mxk.history.login.browser' | i18n }}</th>
<th nzAlign="center">{{ 'mxk.history.login.platform' | i18n }}</th>
<th nzAlign="center">{{ 'mxk.history.login.loginTime' | i18n }}</th>
@@ -91,6 +92,7 @@
<td nzAlign="left">{{ data.username }}</td>
<td nzAlign="left">{{ data.displayName }}</td>
<td nzAlign="left">{{ data.sourceIp }}</td>
<td nzAlign="left">{{ data.location }}</td>
<td nzAlign="left">{{ data.browser }}</td>
<td nzAlign="left">{{ data.platform }}</td>
<td nzAlign="left">{{ data.loginTime }}</td>

View File

@@ -67,6 +67,7 @@
<th nzAlign="center">{{ 'mxk.history.login.message' | i18n }}</th>
<th nzAlign="center">{{ 'mxk.history.login.loginType' | i18n }}</th>
<th nzAlign="center">{{ 'mxk.history.login.sourceIp' | i18n }}</th>
<th nzAlign="center">{{ 'mxk.history.login.location' | i18n }}</th>
<th nzAlign="center">{{ 'mxk.history.login.browser' | i18n }}</th>
<th nzAlign="center">{{ 'mxk.history.login.platform' | i18n }}</th>
<th nzAlign="center">{{ 'mxk.history.login.loginTime' | i18n }}</th>
@@ -80,9 +81,10 @@
</td>
<td nzAlign="left">{{ data.username }}</td>
<td nzAlign="left">{{ data.displayName }}</td>
<td nzAlign="left">{{ data.provider }}</td>
<td nzAlign="left">{{ data.message }}</td>
<td nzAlign="left">{{ data.loginType }}</td>
<td nzAlign="left">{{ data.sourceIp }}</td>
<td nzAlign="left">{{ data.location }}</td>
<td nzAlign="left">{{ data.browser }}</td>
<td nzAlign="left">{{ data.platform }}</td>
<td nzAlign="left">{{ data.loginTime }}</td>

View File

@@ -599,6 +599,7 @@
"login.message": "message",
"login.loginType": "loginType",
"login.sourceIp": "sourceIp",
"login.location": "location",
"login.browser": "browser",
"login.loginTime": "loginTime",
"login.logoutTime": "logoutTime",

View File

@@ -603,6 +603,7 @@
"login.message": "状态",
"login.loginType": "登录方式",
"login.sourceIp": "访问地址",
"login.location": "归属地",
"login.browser": "浏览器",
"login.loginTime": "登录时间",
"login.logoutTime": "退出时间",

View File

@@ -603,6 +603,7 @@
"login.message": "狀態",
"login.loginType": "登錄方式",
"login.sourceIp": "訪問地址",
"login.location": "归属地",
"login.browser": "瀏覽器",
"login.loginTime": "登錄時間",
"login.logoutTime": "退出時間",