|
@@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.core.Ordered;
|
|
|
import org.springframework.core.annotation.Order;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.security.access.AccessDeniedException;
|
|
|
import org.springframework.web.HttpMediaTypeNotSupportedException;
|
|
|
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
|
|
import org.springframework.web.bind.MethodArgumentNotValidException;
|
|
@@ -72,6 +73,13 @@ public class BaseExceptionHandler {
|
|
|
return Result.error(e.getMessage());
|
|
|
}
|
|
|
|
|
|
+ @ExceptionHandler(AccessDeniedException.class)
|
|
|
+ @ResponseStatus(HttpStatus.BAD_REQUEST)
|
|
|
+ public Result accessDeniedException(AccessDeniedException e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return Result.error(e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 参数异常拦截
|