‘liusuyi’
2023-07-01 70210b0eb0c58e1779fd89cbcf0909154d7d4936
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/SdkOperateAspect.java
@@ -1,5 +1,6 @@
package com.ruoyi.framework.aspectj;
import com.ruoyi.common.annotation.SdkOperate;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
@@ -10,13 +11,18 @@
import com.ruoyi.device.camera.service.IArdCamerasService;
import com.ruoyi.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import javax.annotation.Nullable;
import javax.annotation.Resource;
import java.lang.reflect.Method;
import java.util.Date;
import static jdk.nashorn.internal.runtime.regexp.joni.Config.log;
@@ -43,12 +49,14 @@
    @Around("dsPointCut()")
    public Object around(ProceedingJoinPoint point) throws Throwable {
        MethodSignature signature = (MethodSignature) point.getSignature();
        Method method = signature.getMethod();
        Boolean result = controlScopeFilter(point);
        if (result) {
            log.debug("已获取相机控制权");
            log.debug("已获取相机控制权--" + method.getName());
            return point.proceed();
        } else {
            log.debug("未获取相机控制权");
            log.debug("未获取相机控制权--" + method.getName());
            return false;//代替目标方法的返回值
        }
    }
@@ -137,6 +145,5 @@
                }
            }
        }
    }
}