李林
2024-01-02 ce97969fce786a9a1dc0bc18acad6261bee73a21
framework/src/main/java/com/yuanchu/mom/config/PowerConfig.java
@@ -30,6 +30,9 @@
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        if(handler instanceof HandlerMethod) {
            if(request.getRequestURL().toString().equals("http://127.0.0.1:8001/error")){
                return HandlerInterceptor.super.preHandle(request, response, handler);
            }
            HandlerMethod h = (HandlerMethod)handler;
            ValueAuth annotation = h.getMethodAnnotation(ValueAuth.class);
            if(annotation!=null){
@@ -38,7 +41,6 @@
            JSONObject obj = JSONUtil.parseObj(new Jwt().readJWT(request.getHeader("token")).get("data"));
            Integer userId = Integer.parseInt(obj.get("id") + "");
            int i = authMapper.isPower(userId, h.getMethod().getName());
            if (i == 0){
                throw new ErrorException(obj.get("name") + " 无权限访问 " + h.getMethod().getName() + " 接口");
            }