mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-07 01:18:27 +08:00
国际化翻译
This commit is contained in:
parent
5a0465d079
commit
167ea5da82
@ -30,6 +30,13 @@ public class Session implements Serializable{
|
||||
|
||||
public static final int MAX_EXPIRY_DURATION = 60 * 5; //default 5 minutes.
|
||||
|
||||
public class CATEGORY{
|
||||
|
||||
public static final int SIGN = 1;
|
||||
|
||||
public static final int MGMT = 5;
|
||||
}
|
||||
|
||||
public String id;
|
||||
|
||||
public LocalDateTime startTimestamp;
|
||||
|
||||
@ -22,6 +22,7 @@ import java.util.List;
|
||||
|
||||
import org.dromara.maxkey.authn.SignPrincipal;
|
||||
import org.dromara.maxkey.authn.realm.ldap.LdapAuthenticationRealmService;
|
||||
import org.dromara.maxkey.authn.session.Session.CATEGORY;
|
||||
import org.dromara.maxkey.entity.history.HistoryLogin;
|
||||
import org.dromara.maxkey.entity.idm.Groups;
|
||||
import org.dromara.maxkey.entity.idm.UserInfo;
|
||||
@ -148,6 +149,7 @@ public abstract class AbstractAuthenticationRealm {
|
||||
historyLogin.setUsername(userInfo.getUsername());
|
||||
historyLogin.setDisplayName(userInfo.getDisplayName());
|
||||
historyLogin.setInstId(userInfo.getInstId());
|
||||
historyLogin.setCategory(CATEGORY.MGMT);
|
||||
|
||||
Region ipRegion =ipLocationParser.region(userInfo.getLastLoginIp());
|
||||
if(ipRegion != null) {
|
||||
|
||||
@ -22,6 +22,7 @@ import java.util.List;
|
||||
|
||||
import org.dromara.maxkey.authn.SignPrincipal;
|
||||
import org.dromara.maxkey.authn.realm.ldap.LdapAuthenticationRealmService;
|
||||
import org.dromara.maxkey.authn.session.Session.CATEGORY;
|
||||
import org.dromara.maxkey.entity.history.HistoryLogin;
|
||||
import org.dromara.maxkey.entity.idm.Groups;
|
||||
import org.dromara.maxkey.entity.idm.UserInfo;
|
||||
@ -148,6 +149,7 @@ public abstract class AbstractAuthenticationRealm {
|
||||
historyLogin.setUsername(userInfo.getUsername());
|
||||
historyLogin.setDisplayName(userInfo.getDisplayName());
|
||||
historyLogin.setInstId(userInfo.getInstId());
|
||||
historyLogin.setCategory(CATEGORY.SIGN);
|
||||
|
||||
Region ipRegion =ipLocationParser.region(userInfo.getLastLoginIp());
|
||||
if(ipRegion != null) {
|
||||
|
||||
@ -49,6 +49,8 @@ public class HistoryLogin extends JpaEntity implements Serializable{
|
||||
@Column
|
||||
String sessionId;
|
||||
@Column
|
||||
int category;
|
||||
@Column
|
||||
String userId;
|
||||
@Column
|
||||
String username;
|
||||
@ -112,6 +114,14 @@ public class HistoryLogin extends JpaEntity implements Serializable{
|
||||
this.sessionId = sessionId;
|
||||
}
|
||||
|
||||
public int getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(int category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ public class LoginHistoryRepository {
|
||||
insert into mxk_history_login
|
||||
( id ,
|
||||
sessionid ,
|
||||
category ,
|
||||
userid ,
|
||||
username ,
|
||||
displayname ,
|
||||
@ -49,7 +50,7 @@ public class LoginHistoryRepository {
|
||||
application ,
|
||||
sessionstatus ,
|
||||
instid)
|
||||
values( ? , ? , ? , ? , ? , ? , ? , ?, ? , ? , ? , ?, ?, ? , ? , ?, ? , ? , ?)
|
||||
values( ? , ? , ? , ? , ? , ? , ? , ?, ? , ? , ? , ?, ?, ? , ? , ?, ? , ? , ? , ?)
|
||||
""";
|
||||
|
||||
protected JdbcTemplate jdbcTemplate;
|
||||
@ -84,6 +85,7 @@ public class LoginHistoryRepository {
|
||||
new Object[] {
|
||||
historyLogin.getId(),
|
||||
historyLogin.getSessionId(),
|
||||
historyLogin.getCategory(),
|
||||
historyLogin.getUserId(),
|
||||
historyLogin.getUsername(),
|
||||
historyLogin.getDisplayName(),
|
||||
@ -105,6 +107,7 @@ public class LoginHistoryRepository {
|
||||
new int[] {
|
||||
Types.VARCHAR,
|
||||
Types.VARCHAR,
|
||||
Types.INTEGER,
|
||||
Types.VARCHAR,
|
||||
Types.VARCHAR,
|
||||
Types.VARCHAR,
|
||||
|
||||
@ -75,9 +75,13 @@
|
||||
"monthAccessCount": "30 Day Access Count",
|
||||
"monthAppCount": "30 Day TOP 10 App Access Count",
|
||||
"monthBrowserCount": "30 Day TOP 10 Browser Access Count",
|
||||
"monthProvinceAccessCount": "30 Day TOP 10 Province Access Count",
|
||||
"appName": "App",
|
||||
"browser": "Browser",
|
||||
"accessCount": "Count"
|
||||
"accessCount": "Count",
|
||||
"number": "Number",
|
||||
"province": "Province",
|
||||
"accessPV": "Access(PV)"
|
||||
},
|
||||
"users": {
|
||||
"tab.basic": "Basic",
|
||||
|
||||
@ -74,9 +74,13 @@
|
||||
"monthAccessCount": "30日访问情况统计",
|
||||
"monthAppCount": "30日TOP10应用访问统计",
|
||||
"monthBrowserCount": "30日TOP10浏览器访问统计",
|
||||
"monthProvinceAccessCount": "30日TOP10各省份访问统计",
|
||||
"appName": "应用名称",
|
||||
"browser": "浏览器",
|
||||
"accessCount": "访问量"
|
||||
"accessCount": "访问量",
|
||||
"number": "序号",
|
||||
"province": "省份",
|
||||
"accessPV": "浏览量(PV)"
|
||||
},
|
||||
"users": {
|
||||
"tab.basic": "基本信息",
|
||||
|
||||
@ -75,9 +75,13 @@
|
||||
"monthAccessCount": "30日訪問情況統計",
|
||||
"monthAppCount": "30日TOP10應用訪問統計",
|
||||
"monthBrowserCount": "30日TOP10瀏覽器訪問統計",
|
||||
"monthProvinceAccessCount": "30日TOP10各省份訪問統計",
|
||||
"appName": "應用名稱",
|
||||
"browser": "瀏覽器",
|
||||
"accessCount": "訪問量"
|
||||
"accessCount": "訪問量",
|
||||
"number": "序號",
|
||||
"province": "省份",
|
||||
"accessPV": "瀏覽量(PV)"
|
||||
},
|
||||
"users": {
|
||||
"tab.basic": "基本信息",
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* /passport/trust/auth--->/#/passport/trust/auth
|
||||
*/
|
||||
function locationTransform(transPath){
|
||||
var topHref = top.location.href;
|
||||
if(topHref.indexOf('#') <= 0){
|
||||
var loginIndex = topHref.indexOf(transPath);
|
||||
if(loginIndex >- 1){
|
||||
topHref = topHref.substring(0,loginIndex) + '/#' + topHref.substring(loginIndex);
|
||||
top.location.href = topHref;
|
||||
}
|
||||
}
|
||||
}
|
||||
var transPaths = [
|
||||
'/passport/trust/auth'
|
||||
];
|
||||
for (i = 0; i < transPaths.length; i++) {
|
||||
locationTransform(transPaths[i]);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user