mirror of https://gitee.com/topiam/eiam
⚡ 优化代码
parent
2ed71ca215
commit
4ab97e9521
|
@ -39,11 +39,6 @@ import lombok.NonNull;
|
|||
@Builder
|
||||
public class Actor implements Serializable {
|
||||
|
||||
public static final String ACTOR_ID = "actor.id";
|
||||
public static final String ACTOR_TYPE = "actor.type";
|
||||
|
||||
public static final String ACTOR_AUTH_TYPE = "actor.auth_type.keyword";
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -1144169992714000310L;
|
||||
|
||||
|
@ -51,20 +46,17 @@ public class Actor implements Serializable {
|
|||
* 行动者ID
|
||||
*/
|
||||
@NonNull
|
||||
@Field(type = FieldType.Keyword, name = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 行动者类型
|
||||
*/
|
||||
@NonNull
|
||||
@Field(type = FieldType.Keyword, name = "type")
|
||||
private UserType type;
|
||||
|
||||
/**
|
||||
* 身份验证类型
|
||||
*/
|
||||
@Field(type = FieldType.Keyword, name = "auth_type")
|
||||
private String authType;
|
||||
|
||||
}
|
||||
|
|
|
@ -52,67 +52,56 @@ public class GeoLocation implements Serializable {
|
|||
/**
|
||||
* IP
|
||||
*/
|
||||
@Field(type = FieldType.Ip, name = "ip")
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* continent code
|
||||
*/
|
||||
@Field(type = FieldType.Keyword, name = "continent_code")
|
||||
private String continentCode;
|
||||
|
||||
/**
|
||||
* continent Name
|
||||
*/
|
||||
@Field(type = FieldType.Text, name = "continent_code")
|
||||
private String continentName;
|
||||
|
||||
/**
|
||||
* 国家code
|
||||
*/
|
||||
@Field(type = FieldType.Keyword, name = "country_code")
|
||||
private String countryCode;
|
||||
|
||||
/**
|
||||
* 国家名称
|
||||
*/
|
||||
@Field(type = FieldType.Text, name = "country_name")
|
||||
private String countryName;
|
||||
|
||||
/**
|
||||
* 省份code
|
||||
*/
|
||||
@Field(type = FieldType.Keyword, name = "province_code")
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
@Field(type = FieldType.Text, name = "province_name")
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 城市code
|
||||
*/
|
||||
@Field(type = FieldType.Keyword, name = "city_code")
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 城市名称
|
||||
*/
|
||||
@Field(type = FieldType.Text, name = "city_name")
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 地理坐标
|
||||
*/
|
||||
@GeoPointField
|
||||
private GeoPoint point;
|
||||
|
||||
/**
|
||||
* 提供商
|
||||
*/
|
||||
@Field(type = FieldType.Keyword, name = "provider")
|
||||
private GeoLocationProvider provider;
|
||||
|
||||
}
|
||||
|
|
|
@ -50,24 +50,20 @@ public class Target implements Serializable {
|
|||
/**
|
||||
* 目标 ID
|
||||
*/
|
||||
@Field(type = FieldType.Keyword, name = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 目标名称
|
||||
*/
|
||||
@Field(type = FieldType.Keyword, name = "name")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
* 目标类型
|
||||
*/
|
||||
@Field(type = FieldType.Keyword, name = "type")
|
||||
private TargetType type;
|
||||
|
||||
/**
|
||||
* 目标类型名称
|
||||
*/
|
||||
@Field(type = FieldType.Keyword, name = "type_name")
|
||||
private String typeName;
|
||||
}
|
||||
|
|
|
@ -38,21 +38,15 @@ import lombok.NoArgsConstructor;
|
|||
@NoArgsConstructor
|
||||
public class UserAgent implements Serializable {
|
||||
|
||||
@Field(type = FieldType.Keyword, name = "device_type")
|
||||
private String deviceType;
|
||||
|
||||
@Field(type = FieldType.Keyword, name = "platform")
|
||||
private String platform;
|
||||
|
||||
@Field(type = FieldType.Keyword, name = "platform_version")
|
||||
private String platformVersion;
|
||||
|
||||
@Field(type = FieldType.Keyword, name = "browser")
|
||||
private String browser;
|
||||
|
||||
@Field(type = FieldType.Keyword, name = "browser_type")
|
||||
private String browserType;
|
||||
|
||||
@Field(type = FieldType.Keyword, name = "browser_major_version")
|
||||
private String browserMajorVersion;
|
||||
}
|
||||
|
|
|
@ -54,6 +54,13 @@ export default (props: { userId: string }) => {
|
|||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: intl.formatMessage({ id: 'pages.account.user_detail.login_audit.columns.platform' }),
|
||||
ellipsis: true,
|
||||
dataIndex: 'platform',
|
||||
width: 110,
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: intl.formatMessage({ id: 'pages.account.user_detail.login_audit.columns.browser' }),
|
||||
dataIndex: 'browser',
|
||||
|
|
|
@ -67,6 +67,7 @@ export default {
|
|||
'pages.account.user_detail.login_audit.columns.app_name': '应用名称',
|
||||
'pages.account.user_detail.login_audit.columns.client_ip': '客户端IP',
|
||||
'pages.account.user_detail.login_audit.columns.browser': '浏览器',
|
||||
'pages.account.user_detail.login_audit.columns.platform': '操作系统',
|
||||
'pages.account.user_detail.login_audit.columns.location': '地理位置',
|
||||
'pages.account.user_detail.login_audit.columns.event_time': '登录时间',
|
||||
'pages.account.user_detail.login_audit.columns.event_status': '登录结果',
|
||||
|
|
|
@ -221,6 +221,10 @@ declare namespace AccountAPI {
|
|||
export interface UserLoginAuditList {
|
||||
appName: string;
|
||||
clientIp: string;
|
||||
userAgent: {
|
||||
platformVersion:string;
|
||||
platform:string
|
||||
};
|
||||
browser: string;
|
||||
eventStatus: string;
|
||||
eventTime: string;
|
||||
|
|
|
@ -21,6 +21,8 @@ import java.time.LocalDateTime;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cn.topiam.employee.audit.entity.GeoLocation;
|
||||
import cn.topiam.employee.audit.entity.UserAgent;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.springframework.data.elasticsearch.client.elc.NativeQuery;
|
||||
|
@ -275,10 +277,13 @@ public interface UserConverter {
|
|||
if (audit.getEventType().getCode().equals(PortalEventType.LOGIN_PORTAL.getCode())) {
|
||||
result.setAppName(PORTAL.getDesc());
|
||||
}
|
||||
UserAgent userAgent=audit.getUserAgent();
|
||||
GeoLocation geoLocation= audit.getGeoLocation();
|
||||
result.setEventTime(audit.getEventTime());
|
||||
result.setClientIp(audit.getGeoLocation().getIp());
|
||||
result.setBrowser(audit.getUserAgent().getBrowser());
|
||||
result.setLocation(audit.getGeoLocation().getCityName());
|
||||
result.setClientIp(geoLocation.getIp());
|
||||
result.setLocation(geoLocation.getCityName());
|
||||
result.setBrowser(userAgent.getBrowser());
|
||||
result.setPlatform(userAgent.getPlatform()+" "+userAgent.getPlatformVersion());
|
||||
result.setEventStatus(audit.getEventStatus());
|
||||
list.add(result);
|
||||
});
|
||||
|
|
|
@ -53,6 +53,12 @@ public class UserLoginAuditListResult {
|
|||
@Parameter(description = "客户端IP")
|
||||
private String clientIp;
|
||||
|
||||
/**
|
||||
* 操作系统
|
||||
*/
|
||||
@Parameter(description = "操作系统")
|
||||
private String platform;
|
||||
|
||||
/**
|
||||
* 登录结果
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue