feat:后置校验
This commit is contained in:
parent
7c323c2753
commit
f459899a53
@ -96,13 +96,13 @@ public class MongoUserDetailsServiceImpl implements MongoUserDetailsService {
|
||||
* @return 结果
|
||||
*/
|
||||
private Mono<UserDetails> validate(UserDetails details) {
|
||||
if (details instanceof AdminUserDetails) {
|
||||
AdminUserDetails user = (AdminUserDetails) details;
|
||||
if (details instanceof IUser) {
|
||||
IUser user = (IUser) details;
|
||||
return checkMap.entrySet().stream()
|
||||
.filter(entry -> entry.getKey().apply(user))
|
||||
.findFirst()
|
||||
.map(entry -> Mono.<UserDetails>error(entry.getValue().get()))
|
||||
.orElse(Mono.just(user));
|
||||
.orElse(Mono.just(details));
|
||||
}
|
||||
return Mono.just(details);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user