正在显示
1 个修改的文件
包含
2 行增加
和
1 行删除
| 1 | package com.example.gateway.filter; | 1 | package com.example.gateway.filter; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 4 | +import com.alibaba.fastjson.JSONArray; | ||
| 4 | import com.alibaba.fastjson.JSONObject; | 5 | import com.alibaba.fastjson.JSONObject; |
| 5 | import com.example.gateway.model.PERMISSION; | 6 | import com.example.gateway.model.PERMISSION; |
| 6 | import com.example.gateway.model.ROLE; | 7 | import com.example.gateway.model.ROLE; |
| @@ -173,7 +174,7 @@ public class WrapperResponseGlobalFilter implements GlobalFilter, Ordered { | @@ -173,7 +174,7 @@ public class WrapperResponseGlobalFilter implements GlobalFilter, Ordered { | ||
| 173 | String json = stringRedisTemplate.opsForValue().get(redisKey); | 174 | String json = stringRedisTemplate.opsForValue().get(redisKey); |
| 174 | if(json!=null && !json.isEmpty()){ | 175 | if(json!=null && !json.isEmpty()){ |
| 175 | try{ | 176 | try{ |
| 176 | - JSONObject jsonObject = JSONObject.parseObject(json); | 177 | + JSONArray jsonObject = JSONArray.parseArray(json); |
| 177 | List<ROLE> roleList = JSONObject.toJavaObject(jsonObject,List.class); | 178 | List<ROLE> roleList = JSONObject.toJavaObject(jsonObject,List.class); |
| 178 | if(roleList!=null && !roleList.isEmpty()){ | 179 | if(roleList!=null && !roleList.isEmpty()){ |
| 179 | for (ROLE role: roleList){ | 180 | for (ROLE role: roleList){ |
-
请 注册 或 登录 后发表评论