|
@@ -1,11 +1,11 @@
|
|
|
package com.ruoyi.common.helper;
|
|
|
|
|
|
+import cn.dev33.satoken.context.SaHolder;
|
|
|
+import cn.dev33.satoken.context.model.SaStorage;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
-import com.ruoyi.common.utils.ServletUtils;
|
|
|
import lombok.AccessLevel;
|
|
|
import lombok.NoArgsConstructor;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -33,11 +33,11 @@ public class DataPermissionHelper {
|
|
|
}
|
|
|
|
|
|
public static Map<String, Object> getContext() {
|
|
|
- HttpServletRequest request = ServletUtils.getRequest();
|
|
|
- Object attribute = request.getAttribute(DATA_PERMISSION_KEY);
|
|
|
+ SaStorage saStorage = SaHolder.getStorage();
|
|
|
+ Object attribute = saStorage.get(DATA_PERMISSION_KEY);
|
|
|
if (ObjectUtil.isNull(attribute)) {
|
|
|
- request.setAttribute(DATA_PERMISSION_KEY, new HashMap<>());
|
|
|
- attribute = request.getAttribute(DATA_PERMISSION_KEY);
|
|
|
+ saStorage.set(DATA_PERMISSION_KEY, new HashMap<>());
|
|
|
+ attribute = saStorage.get(DATA_PERMISSION_KEY);
|
|
|
}
|
|
|
if (attribute instanceof Map) {
|
|
|
return (Map<String, Object>) attribute;
|