accessDeniedHandler不生效

配置了异常accessDeniedHandler被全局异常捕获了不生效

        //配置异常处理器
        //认证失败处理器
        http.exceptionHandling()
                .authenticationEntryPoint(authenticationEntryPoint)
                //授权失败处理器
                .accessDeniedHandler(accessDeniedHandler);



    @ExceptionHandler(AccessDeniedException.class)
    public void accessDeniedException(AccessDeniedException accessDeniedException) throws AccessDeniedException {
        log.error(accessDeniedException.getMessage(), accessDeniedException);
        throw accessDeniedException;
    }

posted @ 2022-09-29 14:27  Arborblog  阅读(246)  评论(0编辑  收藏  举报