拆分ResponseUtil‘

This commit is contained in:
zlt2000
2020-05-05 18:54:41 +08:00
parent 540c46e90e
commit 4be31c40f8
4 changed files with 61 additions and 47 deletions
@@ -1,6 +1,6 @@
package com.central.gateway.auth;
import com.central.common.utils.ResponseUtil;
import com.central.common.utils.WebfluxResponseUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.AccessDeniedException;
@@ -21,6 +21,6 @@ import reactor.core.publisher.Mono;
public class JsonAccessDeniedHandler implements ServerAccessDeniedHandler {
@Override
public Mono<Void> handle(ServerWebExchange exchange, AccessDeniedException e) {
return ResponseUtil.responseFailed(exchange, HttpStatus.FORBIDDEN.value(), e.getMessage());
return WebfluxResponseUtil.responseFailed(exchange, HttpStatus.FORBIDDEN.value(), e.getMessage());
}
}
@@ -1,6 +1,6 @@
package com.central.gateway.auth;
import com.central.common.utils.ResponseUtil;
import com.central.common.utils.WebfluxResponseUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.security.core.AuthenticationException;
@@ -21,6 +21,6 @@ import reactor.core.publisher.Mono;
public class JsonAuthenticationEntryPoint implements ServerAuthenticationEntryPoint {
@Override
public Mono<Void> commence(ServerWebExchange exchange, AuthenticationException e) {
return ResponseUtil.responseFailed(exchange, HttpStatus.UNAUTHORIZED.value(), e.getMessage());
return WebfluxResponseUtil.responseFailed(exchange, HttpStatus.UNAUTHORIZED.value(), e.getMessage());
}
}