| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.ard.common.exception.NoPermissionException; |
| | | import com.ard.common.exception.ControlException; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.security.access.AccessDeniedException; |
| | |
| | | /** |
| | | * 全局异常处理器 |
| | | * |
| | | * @author ruoyi |
| | | * @author ard |
| | | */ |
| | | @RestControllerAdvice |
| | | public class GlobalExceptionHandler |
| | |
| | | /** |
| | | * 无人机无控制权异常 |
| | | */ |
| | | @ExceptionHandler(NoPermissionException.class) |
| | | public AjaxResult handleNoPermissionException(NoPermissionException e) |
| | | @ExceptionHandler(ControlException.class) |
| | | public AjaxResult handleNoPermissionException(ControlException e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |