From 99091a8cbb8e098575c75a7c640b568addbcc29d Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Sun, 09 Oct 2022 21:41:13 +0800
Subject: [PATCH] Merge branch 'score_shop'

---
 zq-erp/src/main/java/com/matrix/system/common/authority/DefaultAuthorityManager.java |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/common/authority/DefaultAuthorityManager.java b/zq-erp/src/main/java/com/matrix/system/common/authority/DefaultAuthorityManager.java
index 381b643..de5d17c 100644
--- a/zq-erp/src/main/java/com/matrix/system/common/authority/DefaultAuthorityManager.java
+++ b/zq-erp/src/main/java/com/matrix/system/common/authority/DefaultAuthorityManager.java
@@ -1,6 +1,9 @@
 package com.matrix.system.common.authority;
 
 import cn.hutool.crypto.SecureUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
 import com.matrix.core.constance.MatrixConstance;
 import com.matrix.core.pojo.AjaxResult;
 import com.matrix.core.tools.StringUtils;
@@ -13,6 +16,7 @@
 import com.matrix.system.common.init.LocalCache;
 import com.matrix.system.common.service.SysFunctionService;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -151,15 +155,12 @@
         SysUsers sysUser = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
 
         String redisKey = USER_POWER_REDISKEY_PC + SecureUtil.md5(sysUser.getSuId() + "");
-        Map<String, Object> cachePowerMap = LocalCache.get(redisKey);
+        Map<String, Object> cachePowerMap = LocalCache.get(redisKey,new TypeReference<Map<String,Object>>(){});
 
         if (Objects.nonNull(cachePowerMap)) {
-
-            userFunction = (Map<String, SysFunction>) cachePowerMap.get(USERFUNCTION);
-
-            menuFunction = (List<SysFunction>) cachePowerMap.get(MENUSFUNCTION);
-
-            userUrlMapping = (List<String>) cachePowerMap.get(USER_URL_MAPPING);
+            userFunction = JSONObject.parseObject(JSON.toJSONString( cachePowerMap.get(USERFUNCTION)), new TypeReference<Map<String, SysFunction>>(){});
+            menuFunction = JSONObject.parseObject(JSON.toJSONString( cachePowerMap.get(MENUSFUNCTION)) ,new TypeReference<List<SysFunction>>(){});
+            userUrlMapping =JSONObject.parseObject(JSON.toJSONString( cachePowerMap.get(USER_URL_MAPPING)) , new TypeReference<List<String>>(){});
 
         } else {
             // 获取用户所有权限

--
Gitblit v1.9.1