|
@@ -3,6 +3,7 @@ package com.fdkankan.scene.Interceptor;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.URLUtil;
|
|
import cn.hutool.core.util.URLUtil;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.fdkankan.common.constant.CommonStatus;
|
|
import com.fdkankan.common.constant.CommonStatus;
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
import com.fdkankan.common.constant.SceneStatus;
|
|
import com.fdkankan.common.constant.SceneStatus;
|
|
@@ -77,6 +78,8 @@ public class CheckViewBizAuthAspect {
|
|
private ISysLogService sysLogService;
|
|
private ISysLogService sysLogService;
|
|
@Autowired
|
|
@Autowired
|
|
private MyClient myClient;
|
|
private MyClient myClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ISysUserService sysUserService;
|
|
|
|
|
|
|
|
|
|
@Pointcut("@annotation(com.fdkankan.scene.annotation.CheckViewBizAuth)")
|
|
@Pointcut("@annotation(com.fdkankan.scene.annotation.CheckViewBizAuth)")
|
|
@@ -190,14 +193,18 @@ public class CheckViewBizAuthAspect {
|
|
throw new BusinessException(ErrorCode.PASSWORD_ERROR);
|
|
throw new BusinessException(ErrorCode.PASSWORD_ERROR);
|
|
}
|
|
}
|
|
|
|
|
|
- //判断是不是场景归属人的场景,如果不是,则校验是否是授权用户
|
|
|
|
- if(scenePlus.getUserId().intValue() != jyUser.getUserId()){
|
|
|
|
- JySceneUserAuth jySceneUserAuth = jySceneUserAuthService.getSceneViewAuth(num, jyUser.getId());
|
|
|
|
- if(Objects.isNull(jySceneUserAuth)){
|
|
|
|
- throw new BusinessException(ErrorCode.AUTH_FAIL.code(), "无权访问");
|
|
|
|
- }
|
|
|
|
- if (jySceneUserAuth.getLookAuth() == 2 && jySceneUserAuth.getLookEndTime().before(Calendar.getInstance().getTime())){
|
|
|
|
- throw new BusinessException(ErrorCode.AUTH_FAIL.code(), "超出访问截止时间");
|
|
|
|
|
|
+ //查询是否是管理员角色,如果是则有权访问
|
|
|
|
+ long count = sysUserService.count(new LambdaQueryWrapper<SysUser>().eq(SysUser::getId, jyUser.getSysUserId()).in(SysUser::getRoleId, 1, 45));
|
|
|
|
+ if(count == 0){
|
|
|
|
+ //判断是不是场景归属人的场景,如果不是,则校验是否是授权用户
|
|
|
|
+ if(scenePlus.getUserId().intValue() != jyUser.getUserId()){
|
|
|
|
+ JySceneUserAuth jySceneUserAuth = jySceneUserAuthService.getSceneViewAuth(num, jyUser.getId());
|
|
|
|
+ if(Objects.isNull(jySceneUserAuth)){
|
|
|
|
+ throw new BusinessException(ErrorCode.AUTH_FAIL.code(), "无权访问");
|
|
|
|
+ }
|
|
|
|
+ if (jySceneUserAuth.getLookAuth() == 2 && jySceneUserAuth.getLookEndTime().before(Calendar.getInstance().getTime())){
|
|
|
|
+ throw new BusinessException(ErrorCode.AUTH_FAIL.code(), "超出访问截止时间");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|