|
@@ -89,16 +89,19 @@ public class CheckPermitAspect {
|
|
|
@Before("checkCooperationPermit()")
|
|
@Before("checkCooperationPermit()")
|
|
|
public void doBefore(JoinPoint joinPoint) throws Exception {
|
|
public void doBefore(JoinPoint joinPoint) throws Exception {
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
- // 读取session中的用户
|
|
|
|
|
- SSOUser user = ssoLoginHelper.getSsoUser(request.getHeader("token"));
|
|
|
|
|
- if(Objects.isNull(user)){
|
|
|
|
|
- throw new BusinessException(ErrorCode.TOKEN_NOT_FOUND);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
String num = WebUtil.getParameter("num", joinPoint, request);
|
|
String num = WebUtil.getParameter("num", joinPoint, request);
|
|
|
if(StrUtil.isEmpty(num)){
|
|
if(StrUtil.isEmpty(num)){
|
|
|
throw new BusinessException(ErrorCode.PARAM_REQUIRED);
|
|
throw new BusinessException(ErrorCode.PARAM_REQUIRED);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 读取session中的用户
|
|
|
|
|
+ SSOUser user = ssoLoginHelper.getSsoUser(request.getHeader("token"));
|
|
|
|
|
+ if(CollUtil.isEmpty(demoSceneNums) || !demoSceneNums.contains(num)){//非demo场景,需要检验登录用户是否为空
|
|
|
|
|
+ if(Objects.isNull(user)){
|
|
|
|
|
+ throw new BusinessException(ErrorCode.TOKEN_NOT_FOUND);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
ScenePlus scenePlus= scenePlusService.getScenePlusByNum(num);
|
|
ScenePlus scenePlus= scenePlusService.getScenePlusByNum(num);
|
|
|
if(Objects.isNull(scenePlus)){
|
|
if(Objects.isNull(scenePlus)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
@@ -113,7 +116,7 @@ public class CheckPermitAspect {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//判断是否相机登录,是否场景的相机id和相机登录的相机id是否相等,如果都满足,则放行,否则判定为用户登录
|
|
//判断是否相机登录,是否场景的相机id和相机登录的相机id是否相等,如果都满足,则放行,否则判定为用户登录
|
|
|
- if(Objects.nonNull(user.getCameraLogin())
|
|
|
|
|
|
|
+ if(Objects.nonNull(user) && Objects.nonNull(user.getCameraLogin())
|
|
|
&& CommonStatus.YES.code().byteValue() == user.getCameraLogin().intValue()){
|
|
&& CommonStatus.YES.code().byteValue() == user.getCameraLogin().intValue()){
|
|
|
if(scenePlus.getCameraId().equals(user.getCameraId())){
|
|
if(scenePlus.getCameraId().equals(user.getCameraId())){
|
|
|
return;
|
|
return;
|