mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-05-14 01:16:07 +08:00
refactor: 优化用户权限变更事件逻辑
This commit is contained in:
@@ -50,6 +50,11 @@ public class ClearUserAuthorizationCacheEvent extends DefaultAsyncEvent {
|
||||
super.async(doOnEnabled(Mono.fromDirect(publisher).then()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void first(Publisher<?> publisher) {
|
||||
super.first(doOnEnabled(Mono.fromDirect(publisher).then()));
|
||||
}
|
||||
|
||||
public static ClearUserAuthorizationCacheEvent of(Collection<String> collection) {
|
||||
ClearUserAuthorizationCacheEvent event = new ClearUserAuthorizationCacheEvent();
|
||||
if (collection == null || collection.isEmpty()) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class DefaultReactiveAuthenticationManager implements ReactiveAuthenticat
|
||||
.getCache("user-auth")
|
||||
.evictAll(event.getUserId())
|
||||
.doOnError(err -> log.error(err.getMessage(), err))
|
||||
.doOnSuccess(__ -> log.info("clear user {} authentication cache success", event.getUserId()));
|
||||
.doOnSuccess(__ -> log.debug("clear user {} authentication cache success", event.getUserId()));
|
||||
}
|
||||
if (event.isAsync()) {
|
||||
event.first(operator);
|
||||
|
||||
Reference in New Issue
Block a user