Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 添加操作日志是否忽略支持记录当前参数配置;登录接口记录操作日志用户认证信息 #280

Merged
merged 7 commits into from
Mar 27, 2024

Conversation

goten7
Copy link
Contributor

@goten7 goten7 commented Mar 26, 2024

No description provided.

@goten7 goten7 changed the title refactor: 去掉登录接口忽略日志记载注释 feat: 添加操作日志是否忽略支持记录当前参数配置;登录接口记录操作日志用户认证信息 Mar 26, 2024
* @return 忽略记载方法的请求参数
* <p>如果不想记录方法全部或某些参数,则可以配置返回*或者对应参数名(多个用逗号分割)</p>
*/
String ignoreParameter() default "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议使用数组,并且支持 * 进行通配。

@@ -121,6 +123,25 @@ private Mono<Map<String, Object>> doLogin(Mono<Map<String, Object>> parameter) {
});
}

@EventListener
public void fillLoggerInfoAuth(AuthorizationSuccessEvent event) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

单独写一个类来处理此事件

.stream()
.anyMatch(loggerParser -> loggerParser.ignoreParameter(holder).test(parameter));

return holder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用Maps.filter...来处理。减少Map对象的创建。

@zhou-hao zhou-hao merged commit ec5fae8 into hs-web:master Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants