mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-04-27 10:29:37 +08:00
fix 修复 优化dubbo调用跟satoken无关的场景会报错无上下文问题
This commit is contained in:
@@ -87,11 +87,14 @@ public class DataPermissionHelper {
|
||||
* @throws NullPointerException 如果数据权限上下文类型异常,则抛出NullPointerException
|
||||
*/
|
||||
public static Map<String, Object> getContext() {
|
||||
SaStorage saStorage = SaHolder.getStorage();
|
||||
Object attribute = saStorage.get(DATA_PERMISSION_KEY);
|
||||
if (ObjectUtil.isNull(attribute)) {
|
||||
saStorage.set(DATA_PERMISSION_KEY, new HashMap<>());
|
||||
Object attribute = new HashMap<>();
|
||||
if (SaHolder.getContext().isValid()) {
|
||||
SaStorage saStorage = SaHolder.getStorage();
|
||||
attribute = saStorage.get(DATA_PERMISSION_KEY);
|
||||
if (ObjectUtil.isNull(attribute)) {
|
||||
saStorage.set(DATA_PERMISSION_KEY, new HashMap<>());
|
||||
attribute = saStorage.get(DATA_PERMISSION_KEY);
|
||||
}
|
||||
}
|
||||
if (attribute instanceof Map map) {
|
||||
return map;
|
||||
|
||||
Reference in New Issue
Block a user