|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.framework.aspectj;
|
|
|
|
|
import cn.hutool.core.lang.Validator;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.ruoyi.common.annotation.DataScope;
|
|
|
|
|
import com.ruoyi.common.core.domain.BaseEntity;
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
|
@ -145,7 +146,7 @@ public class DataScopeAspect
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(sqlString.toString()))
|
|
|
|
|
{
|
|
|
|
|
putDataScope(joinPoint, sqlString.substring(4));
|
|
|
|
|
putDataScope(joinPoint, "AND (" + sqlString.substring(4) + ")");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -181,6 +182,10 @@ public class DataScopeAspect
|
|
|
|
|
Object params = joinPoint.getArgs()[0];
|
|
|
|
|
if (Validator.isNotNull(params))
|
|
|
|
|
{
|
|
|
|
|
if(params instanceof BaseEntity) {
|
|
|
|
|
BaseEntity baseEntity = (BaseEntity) params;
|
|
|
|
|
baseEntity.getParams().put(DATA_SCOPE, "");
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
|
Method getParams = params.getClass().getDeclaredMethod("getParams", null);
|
|
|
|
|
Map<String, Object> invoke = (Map<String, Object>) getParams.invoke(params, null);
|
|
|
|
@ -190,4 +195,5 @@ public class DataScopeAspect
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|