作者 朱兆平

处理匿名者访问方法转json对象异常问题

@@ -172,6 +172,7 @@ public class WrapperResponseGlobalFilter implements GlobalFilter, Ordered { @@ -172,6 +172,7 @@ public class WrapperResponseGlobalFilter implements GlobalFilter, Ordered {
172 String redisKey = "ROLE_anonymous_routers"; 172 String redisKey = "ROLE_anonymous_routers";
173 String json = stringRedisTemplate.opsForValue().get(redisKey); 173 String json = stringRedisTemplate.opsForValue().get(redisKey);
174 if(json!=null && !json.isEmpty()){ 174 if(json!=null && !json.isEmpty()){
  175 + try{
175 JSONObject jsonObject = JSONObject.parseObject(json); 176 JSONObject jsonObject = JSONObject.parseObject(json);
176 List<ROLE> roleList = JSONObject.toJavaObject(jsonObject,List.class); 177 List<ROLE> roleList = JSONObject.toJavaObject(jsonObject,List.class);
177 if(roleList!=null && !roleList.isEmpty()){ 178 if(roleList!=null && !roleList.isEmpty()){
@@ -186,6 +187,12 @@ public class WrapperResponseGlobalFilter implements GlobalFilter, Ordered { @@ -186,6 +187,12 @@ public class WrapperResponseGlobalFilter implements GlobalFilter, Ordered {
186 } 187 }
187 } 188 }
188 } 189 }
  190 + }catch (Exception e){
  191 + e.printStackTrace();
  192 + return false;
  193 + }
  194 +
  195 +
189 } 196 }
190 return false; 197 return false;
191 } 198 }
  1 +${AnsiColor.YELLOW}
  2 + ##################*CETC-TIANBO*#########################
  3 +
  4 + .::::.
  5 + .::::::::.
  6 + :::::::::::
  7 + ..:::::::::::'
  8 + '::::::::::::'
  9 + .::::::::::
  10 + '::::::::::::::..
  11 + ..::::::::::::.
  12 + ``::::::::::::::::
  13 + ::::``:::::::::' .:::.
  14 + ::::' ':::::' .::::::::.
  15 + .::::' :::: .:::::::'::::.
  16 + .:::' ::::: .:::::::::' ':::::.
  17 + .::' :::::.:::::::::' ':::::.
  18 + .::' ::::::::::::::' ``::::.
  19 + ...::: ::::::::::::' ``::.
  20 + ```` ':. ':::::::::' ::::..
  21 + '.:::::' ':'````..
  22 + #########################################################
  23 +
  24 +
  25 +
  26 +
  27 +==================================================
  28 +Application Info:${application.title}
  29 +ver:${application.version}
  30 +Powered by:Spring Boot ${spring-boot.version}