mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-09 04:49:02 +08:00
Merge remote-tracking branch 'origin/jdk17' into jdk17
This commit is contained in:
commit
e167095932
3 files changed
+30
-40
No files matched your search
+6
-23
@@ -18,16 +18,11 @@ package com.pig4cloud.pigx.common.log.event;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonFilter;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ser.FilterProvider;
|
||||
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
|
||||
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
|
||||
import com.pig4cloud.pigx.admin.api.dto.SysLogDTO;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteLogService;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.jackson.PigxJavaTimeModule;
|
||||
import com.pig4cloud.pigx.common.log.config.PigxLogProperties;
|
||||
import com.pig4cloud.pigx.common.log.util.JacksonSensitiveFieldUtil;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
@@ -52,12 +47,11 @@ public class SysLogListener implements InitializingBean {
|
||||
/**
|
||||
* 忽略序列化的对象类型
|
||||
*/
|
||||
private final static Class[] ignoreClass = { ServletRequest.class, BindingResult.class };
|
||||
private final static Class[] ignoreClass = {ServletRequest.class, BindingResult.class};
|
||||
|
||||
/**
|
||||
* new 一个 避免日志脱敏策略影响全局ObjectMapper
|
||||
*/
|
||||
private final static ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
private final RemoteLogService remoteLogService;
|
||||
|
||||
@@ -79,10 +73,9 @@ public class SysLogListener implements InitializingBean {
|
||||
|
||||
try {
|
||||
// 序列化参数
|
||||
String params = objectMapper.writeValueAsString(list);
|
||||
String params = JacksonSensitiveFieldUtil.getObjectMapper().writeValueAsString(list);
|
||||
source.setParams(StrUtil.subPre(params, logProperties.getMaxLength()));
|
||||
}
|
||||
catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
log.error("请求参数序列化异常:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -93,18 +86,8 @@ public class SysLogListener implements InitializingBean {
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
objectMapper.addMixIn(Object.class, PropertyFilterMixIn.class);
|
||||
String[] ignorableFieldNames = logProperties.getExcludeFields().toArray(new String[0]);
|
||||
|
||||
FilterProvider filters = new SimpleFilterProvider().addFilter("filter properties by name",
|
||||
SimpleBeanPropertyFilter.serializeAllExcept(ignorableFieldNames));
|
||||
objectMapper.setFilterProvider(filters);
|
||||
objectMapper.registerModule(new PigxJavaTimeModule());
|
||||
JacksonSensitiveFieldUtil.configureSensitiveFields(ignorableFieldNames);
|
||||
JacksonSensitiveFieldUtil.registerCustomModule(new PigxJavaTimeModule());
|
||||
}
|
||||
|
||||
@JsonFilter("filter properties by name")
|
||||
class PropertyFilterMixIn {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -89,6 +89,18 @@ public class UserVO implements Serializable {
|
||||
@Schema(description = "开源中国 open id")
|
||||
private String oscOpenId;
|
||||
|
||||
/**
|
||||
* 企微微信 userid
|
||||
*/
|
||||
@Schema(description = "企微微信 userid")
|
||||
private String wxCpUserid;
|
||||
|
||||
/**
|
||||
* 钉钉 userid
|
||||
*/
|
||||
@Schema(description = "钉钉 userid")
|
||||
private String wxDingUserid;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@@ -185,16 +197,5 @@ public class UserVO implements Serializable {
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 企微微信 userid
|
||||
*/
|
||||
@Schema(description = "企微微信 userid")
|
||||
private String wxCpUserid;
|
||||
|
||||
/**
|
||||
* 钉钉 userid
|
||||
*/
|
||||
@Schema(description = "钉钉 userid")
|
||||
private String wxDingUserid;
|
||||
|
||||
}
|
||||
@@ -30,16 +30,16 @@
|
||||
<result column="avatar" property="avatar"/>
|
||||
<result column="wx_openid" property="wxOpenid"/>
|
||||
<result column="qq_openid" property="qqOpenid"/>
|
||||
<result column="wx_cp_userid" property="wxCpUserid"/>
|
||||
<result column="wx_ding_userid" property="wxDingUserid"/>
|
||||
<result column="gitee_login" property="giteeOpenId"/>
|
||||
<result column="osc_id" property="oscOpenId"/>
|
||||
<result column="wx_cp_userid" property="wxCpUserid"/>
|
||||
<result column="wx_ding_userid" property="wxDingUserid"/>
|
||||
<result column="ucreate_time" property="createTime"/>
|
||||
<result column="uupdate_time" property="updateTime"/>
|
||||
<result column="lock_flag" property="lockFlag"/>
|
||||
<result column="password_expire_flag" property="passwordExpireFlag"/>
|
||||
<result column="password_modify_time" property="passwordModifyTime"/>
|
||||
<result column="udel_flag" property="delFlag"/>
|
||||
<result column="del_flag" property="delFlag"/>
|
||||
<result column="dept_id" property="deptId"/>
|
||||
<result column="tenant_id" property="tenantId"/>
|
||||
<result column="dept_name" property="deptName"/>
|
||||
@@ -63,6 +63,8 @@
|
||||
u.avatar,
|
||||
u.wx_openid,
|
||||
u.qq_openid,
|
||||
u.gitee_login,
|
||||
u.osc_id,
|
||||
u.wx_cp_userid,
|
||||
u.wx_ding_userid,
|
||||
u.dept_id,
|
||||
@@ -91,10 +93,10 @@
|
||||
u.avatar,
|
||||
u.wx_openid,
|
||||
u.qq_openid,
|
||||
u.gitee_login,
|
||||
u.wx_cp_userid,
|
||||
u.wx_ding_userid,
|
||||
u.gitee_login,
|
||||
u.osc_id,
|
||||
u.wx_cp_userid,
|
||||
u.wx_ding_userid,
|
||||
u.del_flag,
|
||||
u.lock_flag,
|
||||
u.password_expire_flag,
|
||||
@@ -140,6 +142,8 @@
|
||||
u.avatar,
|
||||
u.wx_openid,
|
||||
u.qq_openid,
|
||||
u.gitee_login,
|
||||
u.osc_id,
|
||||
u.wx_cp_userid,
|
||||
u.wx_ding_userid,
|
||||
u.dept_id,
|
||||
@@ -188,6 +192,8 @@
|
||||
u.avatar,
|
||||
u.wx_openid,
|
||||
u.qq_openid,
|
||||
u.gitee_login,
|
||||
u.osc_id,
|
||||
u.wx_cp_userid,
|
||||
u.wx_ding_userid,
|
||||
u.dept_id,
|
||||
|
||||
Reference in new issue
Block a user