mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 10:13:28 +08:00
feat: 允许在方法入参中添加 dataScope 参数
This commit is contained in:
parent
420c195eb5
commit
df22a7f673
@ -16,7 +16,6 @@ import org.aspectj.lang.annotation.Before;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据过滤处理
|
* 数据过滤处理
|
||||||
@ -139,11 +138,9 @@ public class DataScopeAspect {
|
|||||||
BaseEntity baseEntity = (BaseEntity) params;
|
BaseEntity baseEntity = (BaseEntity) params;
|
||||||
baseEntity.getParams().put(DATA_SCOPE, sql);
|
baseEntity.getParams().put(DATA_SCOPE, sql);
|
||||||
} else if (params instanceof Map) {
|
} else if (params instanceof Map) {
|
||||||
Map<?, ?> tempMap = (Map<?, ?>) params;
|
@SuppressWarnings("unchecked")
|
||||||
Map<String, Object> paramMap = new ConcurrentHashMap<>(tempMap.size() + 1);
|
Map<String, Object> map = (Map<String, Object>) params;
|
||||||
tempMap.forEach((k, v) -> paramMap.put((String) k, v));
|
map.put(DATA_SCOPE, sql);
|
||||||
paramMap.put(DATA_SCOPE, sql);
|
|
||||||
joinPoint.getArgs()[0] = paramMap;
|
|
||||||
} else {
|
} else {
|
||||||
Map<String, Object> invoke = ReflectUtils.invokeGetter(params, "params");
|
Map<String, Object> invoke = ReflectUtils.invokeGetter(params, "params");
|
||||||
invoke.put(DATA_SCOPE, sql);
|
invoke.put(DATA_SCOPE, sql);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user