jiangping
2024-05-11 5adc2541559cfefe3f9794d4a42a705b1ce83172
server/system_service/src/main/java/com/doumee/config/cloudfilter/LoginHandlerInterceptor.java
@@ -32,6 +32,7 @@
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        if(handler instanceof HandlerMethod){
        HandlerMethod handlerMethod = (HandlerMethod) handler;
        Class<?> beanType = handlerMethod.getBeanType();
        if (!beanType.isAnnotationPresent(LoginNoRequired.class) && !handlerMethod.hasMethodAnnotation(LoginNoRequired.class)) {
@@ -72,6 +73,10 @@
                throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"未登录");
            }
        }
        }else{
            throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"未登录");
        }
        return true;
    }