| | |
| | | |
| | | import com.ruoyi.common.annotation.AddOrgId; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.service.IConfigService; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Before; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.lang.reflect.Field; |
| | |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(SetOrgIdAspect.class); |
| | | |
| | | @Autowired |
| | | private IConfigService sysConfigService; |
| | | |
| | | @Before("@annotation(setOrgId)") |
| | | public void setOrgId(JoinPoint joinPoint, AddOrgId setOrgId) throws Throwable |
| | | { |
| | |
| | | { |
| | | String orgid = loginUser.getUser().getOrgid(); |
| | | String campusid = loginUser.getUser().getCampusid(); |
| | | //显示所有院区权限 |
| | | String allCampus = sysConfigService.selectConfigByKey("sys.authority.campus.all"); |
| | | if(StringUtils.isNotEmpty(allCampus)){ |
| | | allCampus = "," + allCampus + ","; |
| | | if (allCampus.contains("," + loginUser.getUser().getUserName() + ",")) { |
| | | campusid = null; |
| | | } |
| | | } |
| | | |
| | | // 获取方法参数 |
| | | Object[] args = joinPoint.getArgs(); |