mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-08 00:49:21 +08:00
删除弃用代码
This commit is contained in:
@@ -28,11 +28,6 @@ import java.util.function.Function;
|
||||
public class AuthorizationFailedEvent extends AbstractAuthorizationEvent {
|
||||
|
||||
private static final long serialVersionUID = -101792832265740828L;
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
@Deprecated//已弃用,请根据exception判断
|
||||
private Reason reason;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
@@ -41,10 +36,8 @@ public class AuthorizationFailedEvent extends AbstractAuthorizationEvent {
|
||||
|
||||
public AuthorizationFailedEvent(String username,
|
||||
String password,
|
||||
Function<String, Object> parameterGetter,
|
||||
Reason reason) {
|
||||
Function<String, Object> parameterGetter) {
|
||||
super(username, password, parameterGetter);
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public Throwable getException() {
|
||||
@@ -55,15 +48,4 @@ public class AuthorizationFailedEvent extends AbstractAuthorizationEvent {
|
||||
this.exception = exception;
|
||||
}
|
||||
|
||||
public Reason getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
@Deprecated//已弃用,请根据exception判断
|
||||
public enum Reason {
|
||||
PASSWORD_ERROR,
|
||||
USER_DISABLED,
|
||||
USER_NOT_EXISTS,
|
||||
OTHER
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,6 @@ public class AuthorizationController {
|
||||
Assert.hasLength(username_, "用户名不能为空");
|
||||
Assert.hasLength(password_, "密码不能为空");
|
||||
|
||||
AuthorizationFailedEvent.Reason reason = AuthorizationFailedEvent.Reason.OTHER;
|
||||
Function<String, Object> parameterGetter = parameters::get;
|
||||
return Mono.defer(() -> {
|
||||
AuthorizationDecodeEvent decodeEvent = new AuthorizationDecodeEvent(username_, password_, parameterGetter);
|
||||
@@ -112,7 +111,7 @@ public class AuthorizationController {
|
||||
}));
|
||||
}));
|
||||
}).onErrorResume(err -> {
|
||||
AuthorizationFailedEvent failedEvent = new AuthorizationFailedEvent(username_, password_, parameterGetter, reason);
|
||||
AuthorizationFailedEvent failedEvent = new AuthorizationFailedEvent(username_, password_, parameterGetter);
|
||||
failedEvent.setException(err);
|
||||
return failedEvent
|
||||
.publish(eventPublisher)
|
||||
|
||||
Reference in New Issue
Block a user