数据权限判断对象类型

This commit is contained in:
RuoYi 2020-08-28 15:45:54 +08:00
parent 4e32788b36
commit 1af0d1665c
1 changed files with 6 additions and 2 deletions

View File

@ -142,8 +142,12 @@ public class DataScopeAspect
if (StringUtils.isNotBlank(sqlString.toString()))
{
BaseEntity baseEntity = (BaseEntity) joinPoint.getArgs()[0];
baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
Object params = joinPoint.getArgs()[0];
if (StringUtils.isNotNull(params) && params instanceof BaseEntity)
{
BaseEntity baseEntity = (BaseEntity) params;
baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
}
}
}